Solver::printStatisticsSafe() is private right now. There is no real reason for that, and as we claim that the driver is only using the regular API we should just make it public.
*/
Statistics getStatistics() const;
+ /**
+ * Print the statistics to the given file descriptor, suitable for usage in
+ * signal handlers.
+ */
+ void printStatisticsSafe(int fd) const;
+
/**
* Determione the output stream for the given tag is enabled. Tags can be
* enabled with the `output` option (and `-o <tag>` on the command line).
/** Reset the API statistics */
void resetStatistics();
- /**
- * Print the statistics to the given file descriptor, suitable for usage in
- * signal handlers.
- */
- void printStatisticsSafe(int fd) const;
-
/** Helper to check for API misuse in mkOp functions. */
void checkMkTerm(Kind kind, uint32_t nchildren) const;
/** Helper for creating operators. */
}
}
+TEST_F(TestApiBlackSolver, printStatisticsSafe)
+{
+ testing::internal::CaptureStdout();
+ d_solver.printStatisticsSafe(STDOUT_FILENO);
+ testing::internal::GetCapturedStdout();
+}
+
TEST_F(TestApiBlackSolver, getUnsatAssumptions1)
{
d_solver.setOption("incremental", "false");
ASSERT_EQ(listhead.getOp(), Op(&d_solver, APPLY_SELECTOR));
}
-TEST_F(TestApiWhiteSolver, printStatisticsSafe)
-{
- testing::internal::CaptureStdout();
- d_solver.printStatisticsSafe(STDOUT_FILENO);
- testing::internal::GetCapturedStdout();
-}
-
} // namespace test
} // namespace cvc5::internal
it--;
++it;
--it;
+ testing::internal::CaptureStdout();
+ d_solver.printStatisticsSafe(STDOUT_FILENO);
+ testing::internal::GetCapturedStdout();
}
} // namespace test
ASSERT_EQ(it, stats.begin());
ss << it->first;
+ testing::internal::CaptureStdout();
+ d_solver.printStatisticsSafe(STDOUT_FILENO);
+ testing::internal::GetCapturedStdout();
}
} // namespace test