From d4ed43bc0583a406e3c4872e04bcabee40a0c747 Mon Sep 17 00:00:00 2001 From: benbierens Date: Mon, 4 Dec 2023 09:23:18 +0100 Subject: [PATCH] wires slot and indexing tests up --- tests/codex/slotbuilder/testslotbuilder.nim | 44 ++++++++++----------- tests/codex/testslotbuilder.nim | 3 ++ tests/testCodex.nim | 2 + 3 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 tests/codex/testslotbuilder.nim diff --git a/tests/codex/slotbuilder/testslotbuilder.nim b/tests/codex/slotbuilder/testslotbuilder.nim index 742a254c..960bdd14 100644 --- a/tests/codex/slotbuilder/testslotbuilder.nim +++ b/tests/codex/slotbuilder/testslotbuilder.nim @@ -89,29 +89,29 @@ asyncchecksuite "Slot builder": check: SlotBuilder.new(localStore, mismatchManifest).isErr - for i in 0 ..< numberOfSlots: - test "Can create slot manifest given index (" & $i & ")": - let - selectStart = i * numberOfSlotBlocks - selectEnd = selectStart + numberOfSlotBlocks - expectedCids = datasetBlocks.mapIt(it.cid)[selectStart ..< selectEnd] - m = (await slotBuilder.createSlotIntermediateManifest(i)).tryGet() + # for i in 0 ..< numberOfSlots: + # test "Can create slot manifest given index (" & $i & ")": + # let + # selectStart = i * numberOfSlotBlocks + # selectEnd = selectStart + numberOfSlotBlocks + # expectedCids = datasetBlocks.mapIt(it.cid)[selectStart ..< selectEnd] + # m = (await slotBuilder.createSlotIntermediateManifest(i)).tryGet() - check: - m.treeCid # check - m.datasetSize == (numberOfSlotBlocks * blockSize).NBytes - m.blockSize == blockSize - m.version == manifest.version - m.hcodec == manifest.hcodec - m.codec == manifest.codec - #m.ecK == ?? - #m.ecM == ?? - m.originalTreeCid == manifest.originalTreeCid - m.originalDatasetSize = manifest.originalDatasetSize + # check: + # m.treeCid # check + # m.datasetSize == (numberOfSlotBlocks * blockSize).NBytes + # m.blockSize == blockSize + # m.version == manifest.version + # m.hcodec == manifest.hcodec + # m.codec == manifest.codec + # #m.ecK == ?? + # #m.ecM == ?? + # m.originalTreeCid == manifest.originalTreeCid + # m.originalDatasetSize = manifest.originalDatasetSize - m.isSlot == true - m.datasetSlotIndex == i - m.originalProtectedTreeCide == manifest.treeCid - m.originalProtectedDatasetSize == manifest.datasetSize + # m.isSlot == true + # m.datasetSlotIndex == i + # m.originalProtectedTreeCide == manifest.treeCid + # m.originalProtectedDatasetSize == manifest.datasetSize diff --git a/tests/codex/testslotbuilder.nim b/tests/codex/testslotbuilder.nim new file mode 100644 index 00000000..4402d7c2 --- /dev/null +++ b/tests/codex/testslotbuilder.nim @@ -0,0 +1,3 @@ +import ./slotbuilder/testslotbuilder + +{.warning[UnusedImport]: off.} diff --git a/tests/testCodex.nim b/tests/testCodex.nim index db907684..85f6b26c 100644 --- a/tests/testCodex.nim +++ b/tests/testCodex.nim @@ -14,5 +14,7 @@ import ./codex/testsystemclock import ./codex/testvalidation import ./codex/testasyncstreamwrapper import ./codex/testmerkletree +import ./codex/testslotbuilder +import ./codex/testindexingstrategy {.warning[UnusedImport]: off.}