diff --git a/onnxruntime/test/logging_apis/test_logging_apis.cc b/onnxruntime/test/logging_apis/test_logging_apis.cc index 0bf3b65bc755a..d72c47493d800 100644 --- a/onnxruntime/test/logging_apis/test_logging_apis.cc +++ b/onnxruntime/test/logging_apis/test_logging_apis.cc @@ -269,23 +269,6 @@ TEST_F(RealCAPITestsFixture, CppApiORTCXXLOGF) { line_num = __LINE__ + 1; ORT_CXX_LOGF_NOEXCEPT(cpp_ort_logger, OrtLoggingLevel::ORT_LOGGING_LEVEL_INFO, "Ignored %d", line_num); - - // - // Test errors due to formatting error. - // - - // Catch expected exception from ORT_CXX_LOGF macro. - try { - line_num = __LINE__ + 1; - ORT_CXX_LOGF(cpp_ort_logger, OrtLoggingLevel::ORT_LOGGING_LEVEL_ERROR, "%ls", "abc"); - FAIL(); - } catch (const Ort::Exception& excpt) { - ASSERT_THAT(excpt.what(), testing::HasSubstr("Failed to log message due to formatting error")); - } - - // The formatting error is ignored with the ORT_CXX_LOGF_NOEXCEPT macro - line_num = __LINE__ + 1; - ORT_CXX_LOGF_NOEXCEPT(cpp_ort_logger, OrtLoggingLevel::ORT_LOGGING_LEVEL_ERROR, "%ls", "abc"); } TEST_F(MockCAPITestsFixture, CppLogMacroBypassCApiCall) {