TEST(Levels, load_nonexistent) { Levels l; l.addPath("/a/non/existent/path"); ASSERT_EQ(0, l.numLevels()); l.addPath("/a"); ASSERT_EQ(0, l.numLevels()); }
TEST(Levels, load_nph) { Levels l; l.addPath("data/L00_title.nph"); ASSERT_EQ(1, l.numLevels()); ASSERT_STREQ("title", l.levelName(0).c_str()); }
TEST(Levels, load_npz) { Levels l; l.addPath("data/C10_Standard.npz"); ASSERT_EQ(9, l.numLevels()); ASSERT_STREQ("plane sailing", l.levelName(0).c_str()); ASSERT_STREQ("the leap", l.levelName(1).c_str()); ASSERT_STREQ("nautilus", l.levelName(8).c_str()); ASSERT_EQ(1, l.numCollections()); ASSERT_EQ(9, l.collectionSize(0)); int indexInCol; ASSERT_EQ(0, l.collectionFromLevel(0, &indexInCol)); ASSERT_EQ(0, indexInCol); ASSERT_EQ(0, l.collectionFromLevel(1, &indexInCol)); ASSERT_EQ(1, indexInCol); }