Browse Source

Test crypt level generator

pull/4650/head
Anders Jenbo 4 years ago
parent
commit
30a6d3412f
  1. 52
      test/drlg_l1_test.cpp
  2. BIN
      test/fixtures/hellfire/21-2122696790.dun
  3. BIN
      test/fixtures/hellfire/22-1191662129.dun
  4. BIN
      test/fixtures/hellfire/23-97055268.dun
  5. BIN
      test/fixtures/hellfire/24-1324803725.dun

52
test/drlg_l1_test.cpp

@ -30,13 +30,16 @@ TEST(Drlg_l1, DRLG_Init_Globals)
void TestCreateL5Dungeon(bool hellfire, int level, uint32_t seed, lvl_entry entry)
{
pMegaTiles = std::make_unique<MegaTile[]>(1648);
MyPlayer->pOriginalCathedral = !hellfire;
if (level >= 1 && level <= 4) {
MyPlayer->pOriginalCathedral = !hellfire;
pMegaTiles = std::make_unique<MegaTile[]>(206);
leveltype = DTYPE_CATHEDRAL;
} else if (level >= 21 && level <= 24) {
pMegaTiles = std::make_unique<MegaTile[]>(216);
leveltype = DTYPE_CRYPT;
}
currlevel = level;
leveltype = DTYPE_CATHEDRAL;
CreateL5Dungeon(seed, entry);
std::string path = paths::BasePath();
@ -157,4 +160,43 @@ TEST(Drlg_l1, CreateL5Dungeon_hellfire_4_1190318991)
EXPECT_EQ(ViewPosition.y, 45);
}
TEST(Drlg_l1, CreateL5Dungeon_crypt_1_2122696790)
{
TestCreateL5Dungeon(true, 21, 2122696790, ENTRY_TWARPUP);
EXPECT_EQ(ViewPosition.x, 61);
EXPECT_EQ(ViewPosition.y, 80);
TestCreateL5Dungeon(true, 21, 2122696790, ENTRY_PREV);
EXPECT_EQ(ViewPosition.x, 53);
EXPECT_EQ(ViewPosition.y, 67);
}
TEST(Drlg_l1, CreateL5Dungeon_crypt_2_1191662129)
{
Quests[Q_PWATER]._qactive = QUEST_NOTAVAIL;
TestCreateL5Dungeon(true, 22, 1191662129, ENTRY_MAIN);
EXPECT_EQ(ViewPosition.x, 71);
EXPECT_EQ(ViewPosition.y, 47);
TestCreateL5Dungeon(true, 22, 1191662129, ENTRY_PREV);
EXPECT_EQ(ViewPosition.x, 85);
EXPECT_EQ(ViewPosition.y, 71);
}
TEST(Drlg_l1, CreateL5Dungeon_crypt_3_97055268)
{
TestCreateL5Dungeon(true, 23, 97055268, ENTRY_MAIN);
EXPECT_EQ(ViewPosition.x, 71);
EXPECT_EQ(ViewPosition.y, 57);
TestCreateL5Dungeon(true, 23, 97055268, ENTRY_PREV);
EXPECT_EQ(ViewPosition.x, 81);
EXPECT_EQ(ViewPosition.y, 59);
}
TEST(Drlg_l1, CreateL5Dungeon_crypt_4_1324803725)
{
TestCreateL5Dungeon(true, 24, 1324803725, ENTRY_MAIN);
EXPECT_EQ(ViewPosition.x, 79);
EXPECT_EQ(ViewPosition.y, 47);
}
} // namespace

BIN
test/fixtures/hellfire/21-2122696790.dun vendored

Binary file not shown.

BIN
test/fixtures/hellfire/22-1191662129.dun vendored

Binary file not shown.

BIN
test/fixtures/hellfire/23-97055268.dun vendored

Binary file not shown.

BIN
test/fixtures/hellfire/24-1324803725.dun vendored

Binary file not shown.
Loading…
Cancel
Save