diff --git a/tests/cell.cpp b/tests/cell.cpp index e213f1aa2..a489f89c1 100644 --- a/tests/cell.cpp +++ b/tests/cell.cpp @@ -23,7 +23,9 @@ class CellTest : public :: testing::Test { if(nc_){ EXPECT_EQ(0, notcurses_stop(nc_)); } - fclose(outfp_); + if(outfp_){ + fclose(outfp_); + } } struct notcurses* nc_{}; diff --git a/tests/fade.cpp b/tests/fade.cpp index d5084c151..1b2b0eb0a 100644 --- a/tests/fade.cpp +++ b/tests/fade.cpp @@ -41,7 +41,9 @@ class FadeTest : public :: testing::Test { if(nc_){ EXPECT_EQ(0, notcurses_stop(nc_)); } - fclose(outfp_); + if(outfp_){ + fclose(outfp_); + } } struct notcurses* nc_{}; diff --git a/tests/libav.cpp b/tests/libav.cpp index 375db77ca..2a16f13c7 100644 --- a/tests/libav.cpp +++ b/tests/libav.cpp @@ -22,7 +22,9 @@ class LibavTest : public :: testing::Test { if(nc_){ EXPECT_EQ(0, notcurses_stop(nc_)); } - fclose(outfp_); + if(outfp_){ + fclose(outfp_); + } } notcurses* nc_{}; diff --git a/tests/ncplane.cpp b/tests/ncplane.cpp index 9ea91edfe..5efc13117 100644 --- a/tests/ncplane.cpp +++ b/tests/ncplane.cpp @@ -24,7 +24,9 @@ class NcplaneTest : public :: testing::Test { if(nc_){ EXPECT_EQ(0, notcurses_stop(nc_)); } - fclose(outfp_); + if(outfp_){ + fclose(outfp_); + } } struct notcurses* nc_{}; diff --git a/tests/notcurses.cpp b/tests/notcurses.cpp index 41f786952..da328eea3 100644 --- a/tests/notcurses.cpp +++ b/tests/notcurses.cpp @@ -23,7 +23,9 @@ class NotcursesTest : public :: testing::Test { if(nc_){ EXPECT_EQ(0, notcurses_stop(nc_)); } - fclose(outfp_); + if(outfp_){ + fclose(outfp_); + } } struct notcurses* nc_{}; diff --git a/tests/panelreel.cpp b/tests/panelreel.cpp index 86b0d3f67..658312cc4 100644 --- a/tests/panelreel.cpp +++ b/tests/panelreel.cpp @@ -23,7 +23,9 @@ class PanelReelTest : public :: testing::Test { if(nc_){ EXPECT_EQ(0, notcurses_stop(nc_)); } - fclose(outfp_); + if(outfp_){ + fclose(outfp_); + } } struct notcurses* nc_{};