Skip to content

Commit 7883074

Browse files
committed
test multiple init/shutdown cycles
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.
1 parent e306e42 commit 7883074

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/include/polyscope_test.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class PolyscopeTest : public ::testing::Test {
3232
polyscope::options::enableRenderErrorChecks = true;
3333
polyscope::options::errorsThrowExceptions = true;
3434
polyscope::options::hideWindowAfterShow = false;
35-
polyscope::init(testBackend);
3635
}
3736

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

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

5152
// You can define per-test tear-down logic as usual.
52-
// virtual void TearDown() { ... }
53+
void TearDown() override {
54+
polyscope::shutdown();
55+
}
5356

5457
// Some expensive resource shared by all tests.
5558
// static T* shared_resource_;

0 commit comments

Comments
 (0)