Added throwing exception when saving untrained SVM model

This commit is contained in:
Daniil Osokin
2014-01-13 11:41:54 +04:00
parent 890f1baff0
commit 5d2edced26
2 changed files with 20 additions and 6 deletions

View File

@@ -155,6 +155,14 @@ TEST(ML_RTrees, save_load) { CV_SLMLTest test( CV_RTREES ); test.safe_run(); }
TEST(ML_ERTrees, save_load) { CV_SLMLTest test( CV_ERTREES ); test.safe_run(); }
TEST(ML_SVM, throw_exception_when_save_untrained_model)
{
SVM svm;
string filename = tempfile("svm.xml");
ASSERT_THROW(svm.save(filename.c_str()), Exception);
remove(filename.c_str());
}
TEST(DISABLED_ML_SVM, linear_save_load)
{
CvSVM svm1, svm2, svm3;