code refactoring

This commit is contained in:
ohyzha
2024-12-19 16:10:41 +02:00
parent 982d2b613b
commit 4e4097d23e
6 changed files with 73 additions and 35 deletions

View File

@@ -26,10 +26,19 @@ TEST_CASE("Load icon")
// load resource that has no numeric ID
Array<char> groupData2 = loader.GetResource("MADVOXEL_ICON", RT_GROUP_ICON);
REQUIRE((!groupData.Empty() && groupData.Size() == groupData2.Size()));
// load resource providing it's full name entry from .rc file without specifying explicit resource type
Array<char> groupData3 = loader.GetResource("MADVOXEL_ICON");
REQUIRE((!groupData.Empty() && !groupData2.Empty() && !groupData3.Empty()));
REQUIRE((groupData.Size() == groupData2.Size() && groupData2.Size() == groupData3.Size()));
// ICON data
Array<char> iconData = loader.GetResource(MAKEINTRESOURCE(1), RT_ICON);
REQUIRE((!iconData.Empty() && iconData.Size() == 194344));
// non-existing resources
Array<char> nonExistingRes = loader.GetResource(1234, RT_FONT);
Array<char> nonExistingRes2 = loader.GetResource("NON_EXISTING_ICON", RT_GROUP_ICON);
REQUIRE((nonExistingRes.Empty() && nonExistingRes2.Empty()));
}