Skip to content

Commit 77d4731

Browse files
committed
TEST: Assert recovery store type from preferences, not hardcoded in-core
The "Recovery file with all in-core data" test hardcoded StoreType::InMemory and relied on ambient preferences, so it failed whenever forceOocData was set: under forceOoc, the recovery file's inline arrays correctly load as out-of-core stores backed by the recovery file itself. * Assert the expected store type via RequireExpectedStoreType, which tracks the active large-data preferences (OutOfCore under forceOoc, InMemory otherwise) * Correct stale comments that claimed OOC was not compiled in Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
1 parent 7d595ee commit 77d4731

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

test/Dream3dLoadingApiTest.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,10 @@ TEST_CASE("Dream3dLoadingApi: Recovery file with all in-core data")
421421
DataStructure srcDs = CreateSimpleTestDataStructure();
422422
fs::path filePath = GetTestOutputDir() / "Dream3dLoadingApiTest_Recovery.dream3d";
423423

424-
// Write as a recovery file — with OOC not compiled in (SIMPLNX_USE_OOC undefined
425-
// for this build), this behaves like WriteFile but exercises the recovery write path
424+
// WriteRecoveryFile writes in-core stores' full data inline (only OOC stores
425+
// are written as lightweight placeholders pointing at their backing files).
426+
// This DataStructure is entirely in-core, so all array data is stored inline
427+
// in the recovery file.
426428
Result<> writeResult = DREAM3D::WriteRecoveryFile(filePath, srcDs);
427429
SIMPLNX_RESULT_REQUIRE_VALID(writeResult);
428430
REQUIRE(fs::exists(filePath));
@@ -435,14 +437,18 @@ TEST_CASE("Dream3dLoadingApi: Recovery file with all in-core data")
435437
const auto& smallPath = k_SmallArrayPath;
436438
const auto& largePath = k_LargeArrayPath;
437439

438-
// All arrays should be in-core since OOC is not compiled in (SIMPLNX_USE_OOC undefined)
440+
// The recovered store type follows the active large-data preferences: under
441+
// forceOocData the arrays load as out-of-core stores backed by the recovery
442+
// file itself (its inline data is read on demand); otherwise they load
443+
// in-core. RequireExpectedStoreType asserts whichever the preferences dictate.
444+
// Either way the data round-trips intact (verified below).
439445
auto* smallArray = ds.getDataAs<IDataArray>(smallPath);
440446
REQUIRE(smallArray != nullptr);
441-
CHECK(smallArray->getStoreType() == IDataStore::StoreType::InMemory);
447+
UnitTest::RequireExpectedStoreType(*smallArray);
442448

443449
auto* largeArray = ds.getDataAs<IDataArray>(largePath);
444450
REQUIRE(largeArray != nullptr);
445-
CHECK(largeArray->getStoreType() == IDataStore::StoreType::InMemory);
451+
UnitTest::RequireExpectedStoreType(*largeArray);
446452

447453
// Verify data integrity through the recovery round-trip
448454
const auto& smallStore = ds.getDataRefAs<Int32Array>(smallPath).getDataStoreRef();

0 commit comments

Comments
 (0)