diff --git a/readLib/testData.cc b/readLib/testData.cc index a17495a77a18e4ce0b5fc0d5c20398cabca564e9..f0b9810d295bf979ab48ad831994b6ccc8c64c65 100644 --- a/readLib/testData.cc +++ b/readLib/testData.cc @@ -35,6 +35,7 @@ const std::string fileNameBZ2 = std::string(TESTDATA)+std::string(".bz2"); TEST_CASE ("Data", "[data]") { #ifdef TEST_WITH_BOOST + SECTION ("c++, uncompressed") { bool b = CorDataCanDeCompress(); CHECK( b==true ); @@ -138,29 +139,30 @@ TEST_CASE ("Data", "[data]") { #else SECTION ("c++") { - CorDataOpenFile(""); + REQUIRE_THROW( CorDataOpenFile("") ); double a[1]; const int length = 1; - CorDataFillArray(a, length); - CorDataCloseFile(); - double v = CorDataNextNumber(); + REQUIRE_THROW( CorDataFillArray(a, length) ); + REQUIRE_THROW( CorDataCloseFile() ); + double v = 0; + REQUIRE_THROW( v = CorDataNextNumber() ); string data; - CorDataNextText(data); - bool b = CorDataCanDeCompress(); - CHECK( b==false ); + REQUIRE_THROW( CorDataNextText(data) ); + CHECK( CorDataCanDeCompress() == false ); } SECTION ("fortran") { - cordataopenfile_(""); + REQUIRE_THROW( cordataopenfile_("") ); double a[1]; const int length = 1; - cordatafillarray_(a, legnth); - cordataclosefile_(); - double d = cordatanextnumber_(); - const char* str = ""; - cordatanexttext_(str, 0); - int b = cordatacandecompress_(); - CHECK( b==0 ); + REQUIRE_THROW( cordatafillarray_(a, length) ); + REQUIRE_THROW( cordataclosefile_() ); + double d = 0; + REQUIRE_THROW( d = cordatanextnumber_() ); + char* str = ""; + REQUIRE_THROW( cordatanexttext_(str, 0) ); + CHECK( cordatacandecompress_() == 0 ); } + #endif }