diff options
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/test_assets.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tests/test_assets.cc b/src/tests/test_assets.cc index a1ae795..5ae266e 100644 --- a/src/tests/test_assets.cc +++ b/src/tests/test_assets.cc @@ -91,6 +91,25 @@ int main() { assert(non_zero_data); printf("Procedural asset DropAsset and re-generation test: SUCCESS\n"); + // Test Texture Asset (TGA loading) + printf("\nRunning Texture Asset test...\n"); + TextureAsset tex = GetTextureAsset(AssetId::ASSET_TEST_IMAGE); + assert(tex.pixels != nullptr); + assert(tex.width == 2); + assert(tex.height == 2); + + // Verify pixels (Expected RGBA) + // Pixel 0: Red (255, 0, 0, 255) + assert(tex.pixels[0] == 255 && tex.pixels[1] == 0 && tex.pixels[2] == 0 && tex.pixels[3] == 255); + // Pixel 1: Green (0, 255, 0, 255) + assert(tex.pixels[4] == 0 && tex.pixels[5] == 255 && tex.pixels[6] == 0 && tex.pixels[7] == 255); + // Pixel 2: Blue (0, 0, 255, 255) + assert(tex.pixels[8] == 0 && tex.pixels[9] == 0 && tex.pixels[10] == 255 && tex.pixels[11] == 255); + // Pixel 3: White (255, 255, 255, 255) + assert(tex.pixels[12] == 255 && tex.pixels[13] == 255 && tex.pixels[14] == 255 && tex.pixels[15] == 255); + + printf("Texture Asset content verification: SUCCESS\n"); + // Test Unknown Procedural Function printf("\nRunning Unknown Procedural Function test...\n"); size_t unknown_size = 0; |
