Fix substitution tests

This commit is contained in:
LexManos 2017-06-26 01:01:23 -07:00
parent 9a09ff68aa
commit c5ffe46f48

View file

@ -99,7 +99,7 @@ public class SubstitutionInjectionTest
assertEquals("ItemBlock points at vanilla block", toSub, dirtitem.getBlock());
// TEST 2: Is the substitute still in the registry? The snapshot was taken before the substitute was added so it should NOT exist
GameData.injectSnapshot(snapshot, true, true);
GameData.injectSnapshot(snapshot, false, true);
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
fnd = blockRegistry.getValue(MC_DIRT);
currDirt = Blocks.DIRT;
@ -120,16 +120,16 @@ public class SubstitutionInjectionTest
dirtitem = (ItemBlock) itemRegistry.getValue(MC_DIRT);
assertEquals("ItemBlock points at vanilla block", toSub, dirtitem.getBlock());
// TEST 2 repeat: Is the substitute still in the registry? The snapshot was taken before the substitute was added so it should NOT exist
// TEST 3: Is the substitute still in the registry? The snapshot was taken before the substitute, but we inject frozen data, so we SHOULD have the sub.
GameData.injectSnapshot(snapshot, true, true);
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
fnd = blockRegistry.getValue(MC_DIRT);
currDirt = Blocks.DIRT;
assertEquals("Got my dirt substitute - Blocks", vanilDirt, currDirt);
assertEquals("Got vanilla dirt - Blocks", toSub, currDirt);
assertEquals("ObjectHolder didn't apply - Blocks and registry", currDirt, fnd);
assertEquals("Got my dirt substitute - registry", vanilDirt, fnd);
assertEquals("Got vanilla dirt - registry", toSub, fnd);
dirtitem = (ItemBlock) itemRegistry.getValue(MC_DIRT);
assertEquals("ItemBlock points at my block", vanilDirt, dirtitem.getBlock());
assertEquals("ItemBlock points at vanilla block", toSub, dirtitem.getBlock());
// TEST 3 repeat: Does the substitute get restored when reverting to frozen state? The substitute should be found in the registry again
GameData.revertToFrozen();