MCPcopy Create free account
hub / github.com/colmap/colmap / TEST

Function TEST

src/colmap/util/logging_test.cc:48–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46void ThrowCheckEqual(const int val) { THROW_CHECK_EQ(val, 1) << "Error!"; }
47
48TEST(ExceptionLogging, Nominal) {
49 EXPECT_NO_THROW(ThrowCheck(true));
50 EXPECT_THROW(ThrowCheck(false), std::invalid_argument);
51 EXPECT_NO_THROW(ThrowCheckEqual(1));
52 EXPECT_THROW(ThrowCheckEqual(0), std::invalid_argument);
53 EXPECT_THROW(THROW_CHECK_NOTNULL(nullptr), std::invalid_argument);
54 EXPECT_THROW({ LOG(FATAL_THROW) << "Error!"; }, std::invalid_argument);
55 EXPECT_THROW(
56 { LOG_FATAL_THROW(std::logic_error) << "Error!"; }, std::logic_error);
57}
58
59// Ensure that the condition is evaluated exactly once
60// for both the positive and negative cases.

Callers

nothing calls this directly

Calls 3

ThrowCheckFunction · 0.85
ThrowCheckEqualFunction · 0.85
PrintingFnFunction · 0.85

Tested by

no test coverage detected