COF off → heap counter fires, mmap counters do not, latency timer fires.
| 205 | |
| 206 | // COF off → heap counter fires, mmap counters do not, latency timer fires. |
| 207 | TEST_F(MmapModuleArchiveFixture, EmitsHeapCounterWhenCofDisabled) { |
| 208 | auto& wrapper = makeWrapper(/*enableCof=*/false); |
| 209 | // Cache dir intentionally NOT set; with COF off it doesn't matter anyway. |
| 210 | |
| 211 | auto result = wrapper.loadModule(STRING_LITERAL(kModuleName), ResourceManagerLoadModuleType::Sources); |
| 212 | ASSERT_TRUE(result) << result.description(); |
| 213 | |
| 214 | EXPECT_EQ(0, _metrics->mmapSuccess.load()); |
| 215 | EXPECT_EQ(0, _metrics->mmapFallback.load()); |
| 216 | EXPECT_GE(_metrics->heap.load(), 1); |
| 217 | EXPECT_EQ(_metrics->heap.load(), _metrics->totalPathCounters()) << "Exactly the heap counter should have fired"; |
| 218 | EXPECT_EQ(_metrics->heap.load(), _metrics->decompressLatencyCalls.load()) |
| 219 | << "Latency timer should fire once per successful decompress"; |
| 220 | EXPECT_EQ(0, _metrics->mmapPublishFail.load()) << "Publish-failure counter is for the mmap path only"; |
| 221 | } |
| 222 | |
| 223 | // COF on but no cache dir → ResourceManager short-circuits to the heap path |
| 224 | // (because _mmapCacheDirectory is empty), so heap counter fires. |
nothing calls this directly
no test coverage detected