@@ -442,8 +442,6 @@ int main(int argc, char *argv[]) {
442442 }
443443 *outStream << " hierarchical image filter has been checked" << std::endl;
444444
445- bool exception_thrown = false ;
446-
447445 // create an image from jpeg file:
448446 *outStream << " creating an image from a jpeg file " << std::endl;
449447 Teuchos::RCP<Image> img_jpg = Teuchos::rcp (new Image (" ./images/ImageB.jpg" ));
@@ -489,19 +487,6 @@ int main(int argc, char *argv[]) {
489487 *outStream << " Error, the jpeg sub image does not have the right intensities." << std::endl;
490488 errorFlag++;
491489 }
492- // // test that unsupported file formats throw an exception
493- // exception_thrown = false;
494- // try{
495- // DICe::Image jpg("./images/invalid.jpg");
496- // }
497- // catch (const std::exception &e){
498- // exception_thrown = true;
499- // *outStream << ".jpg throws an exception as expected" << std::endl;
500- // }
501- // if(!exception_thrown){
502- // *outStream << "Error, an exception should have been thrown for unsupported .jpg file format, but was not" << std::endl;
503- // errorFlag++;
504- // }
505490 // create an image from jpeg file:
506491 *outStream << " creating an image from a png file " << std::endl;
507492 Teuchos::RCP<Image> img_png = Teuchos::rcp (new Image (" ./images/ImageB.png" ));
@@ -547,31 +532,6 @@ int main(int argc, char *argv[]) {
547532 *outStream << " Error, the png sub image does not have the right intensities." << std::endl;
548533 errorFlag++;
549534 }
550- // // test that unsupported file formats throw an exception
551- // exception_thrown = false;
552- // try{
553- // DICe::Image png("./images/invalid.png");
554- // }
555- // catch (const std::exception &e){
556- // exception_thrown = true;
557- // *outStream << ".png throws an exception as expected" << std::endl;
558- // }
559- // if(!exception_thrown){
560- // *outStream << "Error, an exception should have been thrown for invalid .png file format, but was not" << std::endl;
561- // errorFlag++;
562- // }
563- // test that unsupported file formats throw an exception
564- try {
565- DICe::Image bmp (" ./images/invalid.bmp" );
566- }
567- catch (const std::exception &e){
568- exception_thrown = true ;
569- *outStream << " .bmp throws an exception as expected" << std::endl;
570- }
571- if (!exception_thrown){
572- *outStream << " Error, an exception should have been thrown for invalid .bmp file format, but was not" << std::endl;
573- errorFlag++;
574- }
575535
576536 *outStream << " --- End test ---" << std::endl;
577537
0 commit comments