diff --git a/test/src/basics_test.cpp b/test/src/basics_test.cpp index 7f2cdc9d..a8e7296a 100644 --- a/test/src/basics_test.cpp +++ b/test/src/basics_test.cpp @@ -89,7 +89,7 @@ TEST_F(PolyscopeTest, ShutdownAndReinitialize) { SetUpTestSuite(); polyscope::show(3); - // do it twice -- we've had some bugs where the first shutdown doesn't clean up properly + // do it twice -- we've had some bugs where the first shutdown doesn't clean up properly polyscope::shutdown(); SetUpTestSuite(); polyscope::show(3); @@ -110,6 +110,24 @@ TEST_F(PolyscopeTest, EmptyBuffer) { polyscope::removeAllStructures(); } +TEST_F(PolyscopeTest, WindowProperties) { + + // set/get window size + polyscope::view::setWindowSize(300, 1000); + int32_t w, h; + std::tie(w, h) = polyscope::view::getWindowSize(); + EXPECT_EQ(w, 300); + EXPECT_EQ(h, 1000); + + // get buffer size + // (hard to say what this should be, given hi-dpi etc) + std::tie(w, h) = polyscope::view::getBufferSize(); + + // resizable + polyscope::view::setWindowResizable(false); + EXPECT_FALSE(polyscope::view::getWindowResizable()); +} + TEST_F(PolyscopeTest, Screenshot) { polyscope::screenshot("test_screeshot.png"); } TEST_F(PolyscopeTest, ScreenshotBuffer) {