#include "sc2k/render/atlas_compaction.hpp" #include #include "test_harness.hpp" int main() { using sc2k::render::atlas_should_compact; CHECK(!atlas_should_compact(1348, 1348, 1)); // initial complete scene CHECK(!atlas_should_compact(1824, 1762, 2)); // a small stale tail keeps the hot atlas CHECK(atlas_should_compact(2093, 1583, 2)); // measured terrain-edit fragmentation CHECK(!atlas_should_compact(1127, 1000, 2)); // retain fewer than 128 stale sprites CHECK(atlas_should_compact(1128, 1000, 2)); // compact once the fixed floor is reached CHECK(!atlas_should_compact(10000, 9700, 3)); // 300 stale entries are insignificant here CHECK(atlas_should_compact(100, 100, 7)); // retain the existing page-count safety bound if (failures == 0) { std::printf("atlas compaction: stale terrain history is bounded\n"); return 0; } std::printf("atlas compaction: %d failure(s)\n", failures); return 1; }