From 63286ecf5acc5ddaec974731546bf7c3a9aae308 Mon Sep 17 00:00:00 2001 From: ahcorde Date: Wed, 12 Oct 2022 22:02:08 +0200 Subject: [PATCH 1/2] Improved coverage Grid Signed-off-by: ahcorde --- src/Grid_TEST.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Grid_TEST.cc b/src/Grid_TEST.cc index bbb21e8ff..f04b1c519 100644 --- a/src/Grid_TEST.cc +++ b/src/Grid_TEST.cc @@ -70,6 +70,8 @@ void GridTest::Grid(const std::string &_renderEngine) grid->SetVerticalCellCount(2u); EXPECT_EQ(2u, grid->VerticalCellCount()); + grid->PreRender(); + // create material MaterialPtr mat = scene->CreateMaterial(); mat->SetAmbient(0.6, 0.7, 0.8); @@ -83,6 +85,11 @@ void GridTest::Grid(const std::string &_renderEngine) EXPECT_EQ(math::Color(0.3f, 0.8f, 0.2f), gridMat->Diffuse()); EXPECT_EQ(math::Color(0.4f, 0.9f, 1.0f), gridMat->Specular()); + MaterialPtr matNull = nullptr; + grid->SetMaterial(matNull, false); + gridMat = grid->Material(); + ASSERT_NE(nullptr, gridMat); + // Clean up engine->DestroyScene(scene); unloadEngine(engine->Name()); From 6cc2bd485c155d33f811603a2b45bd4e3c469965 Mon Sep 17 00:00:00 2001 From: ahcorde Date: Wed, 12 Oct 2022 22:28:31 +0200 Subject: [PATCH 2/2] Increased coverage Signed-off-by: ahcorde --- src/Grid_TEST.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Grid_TEST.cc b/src/Grid_TEST.cc index f04b1c519..5968d74d5 100644 --- a/src/Grid_TEST.cc +++ b/src/Grid_TEST.cc @@ -90,6 +90,9 @@ void GridTest::Grid(const std::string &_renderEngine) gridMat = grid->Material(); ASSERT_NE(nullptr, gridMat); + grid->SetVerticalCellCount(3u); + grid->PreRender(); + // Clean up engine->DestroyScene(scene); unloadEngine(engine->Name());