summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-05 16:41:14 +0100
committerskal <pascal.massimino@gmail.com>2026-02-05 16:41:14 +0100
commit371e68c5284359daea0446dfc674473a1461614a (patch)
tree8e7acbfa96917bd060aeca5276c78d431755329a /src/tests
parentf6f3c13fcd287774a458730722854baab8a17366 (diff)
feat(assets): Add Texture Asset support (Task #18.0 prep)
- Integrated stb_image for image decompression in asset_packer. - Added GetTextureAsset helper in asset_manager. - Updated procedural asset generation to include dimensions header for consistency. - Updated test_assets to verify new asset format.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_assets.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/tests/test_assets.cc b/src/tests/test_assets.cc
index 128bb1c..a1ae795 100644
--- a/src/tests/test_assets.cc
+++ b/src/tests/test_assets.cc
@@ -54,13 +54,15 @@ int main() {
const uint8_t* proc_data_1 =
GetAsset(AssetId::ASSET_PROC_NOISE_256, &proc_size);
assert(proc_data_1 != nullptr);
- assert(proc_size == 256 * 256 * 4); // 256x256 RGBA8
+ // Expect 256x256 RGBA8 + 8 byte header
+ assert(proc_size == 256 * 256 * 4 + 8);
- // Verify first few bytes are not all zero (noise should produce non-zero
- // data)
+ // Verify first few bytes of DATA (skip header)
+ // Header is 8 bytes
+ const uint8_t* pixel_data_1 = proc_data_1 + 8;
bool non_zero_data = false;
- for (size_t i = 0; i < 16; ++i) { // Check first 16 bytes
- if (proc_data_1[i] != 0) {
+ for (size_t i = 0; i < 16; ++i) { // Check first 16 bytes of pixels
+ if (pixel_data_1[i] != 0) {
non_zero_data = true;
break;
}
@@ -79,8 +81,9 @@ int main() {
// Verify content again to ensure it was re-generated correctly
non_zero_data = false;
+ const uint8_t* pixel_data_2 = proc_data_2 + 8;
for (size_t i = 0; i < 16; ++i) {
- if (proc_data_2[i] != 0) {
+ if (pixel_data_2[i] != 0) {
non_zero_data = true;
break;
}