MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / check_root

Function check_root

tests/BS_thread_pool_test.cpp:2838–2849  ·  view source on GitHub ↗

* @brief Check if a condition is met, report the result, but do not keep count of the total number of successes and failures, because failure is expected if the test is not run as root. * * @param condition The condition to check. */

Source from the content-addressed store, hash-verified

2836 * @param condition The condition to check.
2837 */
2838void check_root(const bool condition)
2839{
2840 if (condition)
2841 {
2842 logln("-> passed.");
2843 ++test_results::tests_succeeded;
2844 }
2845 else
2846 {
2847 logln("-> failed, most likely due to insufficient permissions; ignoring.");
2848 }
2849}
2850
2851/**
2852 * @brief Check if the expected result has been obtained, report the result, but do not keep count of the total number of successes and failures, because failure is expected if the test is not run as root.

Callers 2

Calls 2

loglnFunction · 0.85
logFunction · 0.85

Tested by

no test coverage detected