Fix test failures, change some CHECK to REQUIRE.

This commit is contained in:
Kevin Ring 2023-08-31 09:23:30 +10:00
parent 5637a68f30
commit 7c8f4b1473
2 changed files with 8 additions and 7 deletions

View File

@ -124,7 +124,7 @@ TEST_CASE("Test creating tileset json loader") {
CHECK(pTilesetJson->getParent() == nullptr);
auto pRootTile = &pTilesetJson->getChildren()[0];
CHECK(pRootTile->getParent() == pTilesetJson);
CHECK(pRootTile->getChildren().size() == 4);
REQUIRE(pRootTile->getChildren().size() == 4);
CHECK(pRootTile->getGeometricError() == 70.0);
CHECK(pRootTile->getRefine() == TileRefine::Replace);
CHECK(std::get<std::string>(pRootTile->getTileID()) == "parent.b3dm");
@ -364,7 +364,7 @@ TEST_CASE("Test creating tileset json loader") {
REQUIRE(loaderResult.pRootTile->getChildren().size() == 1);
auto pRootTile = &loaderResult.pRootTile->getChildren()[0];
CHECK(pRootTile->isExternalContent());
CHECK(pRootTile->getChildren().size() == 1);
REQUIRE(pRootTile->getChildren().size() == 1);
CHECK(pRootTile->getTransform() == glm::dmat4(glm::dmat3(2.0)));
const Tile& child = pRootTile->getChildren().front();
@ -387,7 +387,7 @@ TEST_CASE("Test creating tileset json loader") {
REQUIRE(loaderResult.pRootTile->getChildren().size() == 1);
auto pRootTile = &loaderResult.pRootTile->getChildren()[0];
CHECK(pRootTile->isExternalContent());
CHECK(pRootTile->getChildren().size() == 1);
REQUIRE(pRootTile->getChildren().size() == 1);
CHECK(pRootTile->getTransform() == glm::dmat4(glm::dmat3(2.0)));
const Tile& child = pRootTile->getChildren().front();

View File

@ -1655,8 +1655,8 @@ TEST_CASE("Additive-refined tiles are added to the tilesFadingOut array") {
updateResult = tileset.updateView({viewState});
}
// All three tiles should be rendered.
CHECK(updateResult.tilesToRenderThisFrame.size() == 3);
// All three tiles (plus the tileset.json) should be rendered.
CHECK(updateResult.tilesToRenderThisFrame.size() == 4);
// Zoom way out
std::optional<Cartographic> position = viewState.getPositionCartographic();
@ -1672,7 +1672,8 @@ TEST_CASE("Additive-refined tiles are added to the tilesFadingOut array") {
viewState.getVerticalFieldOfView());
updateResult = tileset.updateView({zoomedOut});
// Only the root tile is visible now, and the other two are fading out.
CHECK(updateResult.tilesToRenderThisFrame.size() == 1);
// Only the root tile (plus the tileset.json) is visible now, and the other
// two are fading out.
CHECK(updateResult.tilesToRenderThisFrame.size() == 2);
CHECK(updateResult.tilesFadingOut.size() == 2);
}