Skip to content

Commit d3518e8

Browse files
committed
add window properties test
1 parent 4d3cb77 commit d3518e8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

test/src/basics_test.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ TEST_F(PolyscopeTest, ShutdownAndReinitialize) {
8989
SetUpTestSuite();
9090
polyscope::show(3);
9191

92-
// do it twice -- we've had some bugs where the first shutdown doesn't clean up properly
92+
// do it twice -- we've had some bugs where the first shutdown doesn't clean up properly
9393
polyscope::shutdown();
9494
SetUpTestSuite();
9595
polyscope::show(3);
@@ -110,6 +110,24 @@ TEST_F(PolyscopeTest, EmptyBuffer) {
110110
polyscope::removeAllStructures();
111111
}
112112

113+
TEST_F(PolyscopeTest, WindowProperties) {
114+
115+
// set/get window size
116+
polyscope::view::setWindowSize(300, 1000);
117+
int32_t w, h;
118+
std::tie(w, h) = polyscope::view::getWindowSize();
119+
EXPECT_EQ(w, 300);
120+
EXPECT_EQ(h, 1000);
121+
122+
// get buffer size
123+
// (hard to say what this should be, given hi-dpi etc)
124+
std::tie(w, h) = polyscope::view::getBufferSize();
125+
126+
// resizable
127+
polyscope::view::setWindowResizable(false);
128+
EXPECT_FALSE(polyscope::view::getWindowResizable());
129+
}
130+
113131
TEST_F(PolyscopeTest, Screenshot) { polyscope::screenshot("test_screeshot.png"); }
114132

115133
TEST_F(PolyscopeTest, ScreenshotBuffer) {

0 commit comments

Comments
 (0)