Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Sep 10, 2023
1 parent 8b118cb commit d86373d
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions test/automap_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ TEST(Automap, AutomapZoomIn)
AutoMapScale = 50;
AutomapZoomIn();
EXPECT_EQ(AutoMapScale, 75);
EXPECT_EQ(AmLine(AmLineLength::DoubleTile), AmLineLength::FullAndHalfTile);
EXPECT_EQ(AmLine(AmLineLength::FullTile), static_cast<AmLineLength>(6));
EXPECT_EQ(AmLine(AmLineLength::HalfTile), AmLineLength::ThirdTile);
EXPECT_EQ(AmLine(AmLineLength::ThirdTile), AmLineLength::QuarterTile);
EXPECT_EQ(AmLine(AmLineLength::HalfTile), static_cast<AmLineLength>(3));
EXPECT_EQ(AmLine(AmLineLength::QuarterTile), static_cast<AmLineLength>(1));
}

Expand All @@ -80,33 +80,30 @@ TEST(Automap, AutomapZoomIn_Max)
EXPECT_EQ(AmLine(AmLineLength::DoubleTile), static_cast<AmLineLength>(32));
EXPECT_EQ(AmLine(AmLineLength::FullTile), AmLineLength::DoubleTile);
EXPECT_EQ(AmLine(AmLineLength::HalfTile), AmLineLength::FullTile);
EXPECT_EQ(AmLine(AmLineLength::ThirdTile), static_cast<AmLineLength>(6));
EXPECT_EQ(AmLine(AmLineLength::QuarterTile), AmLineLength::HalfTile);
}

TEST(Automap, AutomapZoomOut)
{
AutoMapScale = 200;
AutomapZoomOut();
EXPECT_EQ(AutoMapScale, 195);
EXPECT_EQ(AmLine(64), 124);
EXPECT_EQ(AmLine(32), 62);
EXPECT_EQ(AmLine(16), 31);
EXPECT_EQ(AmLine(8), 15);
EXPECT_EQ(AmLine(4), 7);
EXPECT_EQ(AutoMapScale, 175);
EXPECT_EQ(AmLine(AmLineLength::DoubleTile), static_cast<AmLineLength>(28));
EXPECT_EQ(AmLine(AmLineLength::FullTile), static_cast<AmLineLength>(14));
EXPECT_EQ(AmLine(AmLineLength::HalfTile), static_cast<AmLineLength>(7));
EXPECT_EQ(AmLine(AmLineLength::QuarterTile), static_cast<AmLineLength>(3));
}

TEST(Automap, AutomapZoomOut_Min)
{
AutoMapScale = 55;
AutoMapScale = 50;
AutomapZoomOut();
AutomapZoomOut();
EXPECT_EQ(AutoMapScale, 50);
EXPECT_EQ(AmLine(64), 32);
EXPECT_EQ(AmLine(32), 16);
EXPECT_EQ(AmLine(16), 8);
EXPECT_EQ(AmLine(8), 4);
EXPECT_EQ(AmLine(4), 2);
EXPECT_EQ(AutoMapScale, 25);
EXPECT_EQ(AmLine(AmLineLength::DoubleTile), AmLineLength::HalfTile);
EXPECT_EQ(AmLine(AmLineLength::FullTile), AmLineLength::QuarterTile);
EXPECT_EQ(AmLine(AmLineLength::HalfTile), static_cast<AmLineLength>(1));
EXPECT_EQ(AmLine(AmLineLength::QuarterTile), static_cast<AmLineLength>(0));
}

TEST(Automap, AutomapZoomReset)
Expand All @@ -118,9 +115,8 @@ TEST(Automap, AutomapZoomReset)
EXPECT_EQ(AutomapOffset.deltaX, 0);
EXPECT_EQ(AutomapOffset.deltaY, 0);
EXPECT_EQ(AutoMapScale, 50);
EXPECT_EQ(AmLine(64), 32);
EXPECT_EQ(AmLine(32), 16);
EXPECT_EQ(AmLine(16), 8);
EXPECT_EQ(AmLine(8), 4);
EXPECT_EQ(AmLine(4), 2);
EXPECT_EQ(AmLine(AmLineLength::DoubleTile), AmLineLength::FullTile);
EXPECT_EQ(AmLine(AmLineLength::FullTile), AmLineLength::HalfTile);
EXPECT_EQ(AmLine(AmLineLength::HalfTile), AmLineLength::QuarterTile);
EXPECT_EQ(AmLine(AmLineLength::QuarterTile), static_cast<AmLineLength>(1));
}

0 comments on commit d86373d

Please sign in to comment.