Skip to content

Commit

Permalink
Fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatdongdang authored Jun 11, 2024
1 parent 81362c9 commit c7da208
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/minecraft_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,6 @@ TEST_CASE("Test the main mcpp class") {

CHECK_EQ(returnVector, expected);
}

SUBCASE("setPlayerTilePosition and getPlayerTilePosition") {
Coordinate testLoc1(180.6, 100.9, 154.7);
Coordinate testLoc2(testLoc1.x, testLoc1.y - 1, testLoc1.z);

mc.setBlock(testLoc2, Blocks::DIRT);
mc.setPlayerTilePosition(testLoc1);

Coordinate result = mc.getPlayerTilePosition();
Coordinate expected(180, 100, 154);

CHECK_EQ(result, expected);
}
}

// Requires player joined to server, will throw serverside if player is not
Expand All @@ -191,6 +178,19 @@ TEST_CASE("Player operations") {
mc.doCommand("tp -2 100 -2");
CHECK_EQ(mc.getPlayerPosition(), negativeLoc);
}

SUBCASE("setPlayerTilePosition and getPlayerTilePosition") {
Coordinate testLoc1(180.6, 100.9, 154.7);
Coordinate testLoc2(testLoc1.x, testLoc1.y - 1, testLoc1.z);

mc.setBlock(testLoc2, Blocks::DIRT);
mc.setPlayerTilePosition(testLoc1);

Coordinate result = mc.getPlayerTilePosition();
Coordinate expected(180, 100, 154);

CHECK_EQ(result, expected);
}
}

#endif
Expand Down

0 comments on commit c7da208

Please sign in to comment.