Skip to content

Commit

Permalink
add window properties test
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwsharp committed Dec 30, 2024
1 parent 4d3cb77 commit d3518e8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/src/basics_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit d3518e8

Please sign in to comment.