BadArgTest::BadArgTest()
{
- progress = -1;
- test_case_idx = -1;
- freq = cv::getTickFrequency();
+ progress = -1;
+ test_case_idx = -1;
+ freq = cv::getTickFrequency();
+ // oldErrorCbk = 0;
+ // oldErrorCbkData = 0;
}
BadArgTest::~BadArgTest(void)
return errcount;
}
-
/*****************************************************************************************\
* Base Class for Test System *
\*****************************************************************************************/
return "Generic/Unknown";
}
+static int tsErrorCallback( int status, const char* func_name, const char* err_msg, const char* file_name, int line, TS* ts )
+{
+ ts->printf(TS::LOG, "OpenCV Error: %s (%s) in %s, file %s, line %d\n", cvErrorStr(status), err_msg, func_name[0] != 0 ? func_name : "unknown function", file_name, line);
+ return 0;
+}
+
/************************************** Running tests **********************************/
void TS::init( const string& modulename )
data_path = string(buf);
}
+ cv::redirectError((cv::ErrorCallback)tsErrorCallback, this);
+
if( ::testing::GTEST_FLAG(catch_exceptions) )
{
- cvSetErrMode( CV_ErrModeParent );
- cvRedirectError( cvStdErrReport );
#if defined WIN32 || defined _WIN32
#ifdef _MSC_VER
_set_se_translator( SEHTranslator );
}
else
{
- cvSetErrMode( CV_ErrModeLeaf );
- cvRedirectError( cvGuiBoxReport );
#if defined WIN32 || defined _WIN32
#ifdef _MSC_VER
_set_se_translator( 0 );