Skip to content

Commit

Permalink
test multiple init/shutdown cycles
Browse files Browse the repository at this point in the history
In `PolyscopeTest` fixture, initialise polyscope at the start of each test and shutdown at the end. This will test multiple shutdown cycles during the lifetime of the fixture.
  • Loading branch information
giorgek-rfpro committed Oct 1, 2024
1 parent eae79f6 commit 24e3ab5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/include/polyscope_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class PolyscopeTest : public ::testing::Test {
polyscope::options::enableRenderErrorChecks = true;
polyscope::options::errorsThrowExceptions = true;
polyscope::options::hideWindowAfterShow = false;
polyscope::init(testBackend);
}

// Per-test-suite tear-down.
Expand All @@ -46,10 +45,14 @@ class PolyscopeTest : public ::testing::Test {
*/

// You can define per-test set-up logic as usual.
// virtual void SetUp() { ... }
void SetUp() override {
polyscope::init(testBackend);
}

// You can define per-test tear-down logic as usual.
// virtual void TearDown() { ... }
void TearDown() override {
polyscope::shutdown();
}

// Some expensive resource shared by all tests.
// static T* shared_resource_;
Expand Down

0 comments on commit 24e3ab5

Please sign in to comment.