From 0861a9ba932d7ff5ee8c7f658314a995bb1bea5a Mon Sep 17 00:00:00 2001 From: abeaucha Date: Mon, 30 Sep 2024 20:06:45 -0400 Subject: [PATCH] tests for bad files --- .../six.sidd/unittests/test_valid_sixsidd.cpp | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp b/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp index e1348d29f..1b78c9e27 100644 --- a/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp +++ b/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp @@ -198,6 +198,15 @@ TEST_CASE(test_read_sidd300_v13_xml) test_read_sidd_xml(testName, "sidd300_ISM-v13.xml"); } +TEST_CASE(test_read_sidd200_bad_xml) +{ + const auto schemaPaths = getSchemaPaths(); + test_read_sidd_xml(testName, "sidd200.xml"); + TEST_SPECIFIC_EXCEPTION( + test_read_sidd_xml(testName, "sidd200-bad.xml", &schemaPaths), + six::DESValidationException); +} + TEST_CASE(test_read_sidd300_bad_xml) { const auto schemaPaths = getSchemaPaths(); @@ -206,6 +215,14 @@ TEST_CASE(test_read_sidd300_bad_xml) six::DESValidationException); } +TEST_CASE(test_read_sidd300_v13_bad_xml) +{ + const auto schemaPaths = getSchemaPaths(); + TEST_SPECIFIC_EXCEPTION( + test_read_sidd_xml(testName, "sidd300_ISM-v13-bad.xml", &schemaPaths), + six::DESValidationException); +} + TEST_MAIN( TEST_CHECK(test_createFakeDerivedData); TEST_CHECK(test_createFakeDerivedData_validate); @@ -213,5 +230,7 @@ TEST_MAIN( TEST_CHECK(test_read_sidd200_xml); TEST_CHECK(test_read_sidd300_xml); TEST_CHECK(test_read_sidd300_v13_xml); - TEST_CHECK(test_read_pathological00_xml); + TEST_CHECK(test_read_sidd200_bad_xml); + TEST_CHECK(test_read_sidd300_bad_xml); + TEST_CHECK(test_read_sidd300_v13_bad_xml); )