0000670: Problem with the Print method.
authorabv <abv@opencascade.com>
Thu, 19 Nov 2015 12:20:39 +0000 (15:20 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 19 Nov 2015 12:31:21 +0000 (15:31 +0300)
Test for issue #670 corrected to avoid unpredictable behavior

src/QABugs/QABugs_11.cxx
tests/bugs/fclasses/bug670

index 830794b..f74ea41 100644 (file)
@@ -1705,8 +1705,16 @@ static Standard_Integer OCC670 (Draw_Interpretor& di, Standard_Integer argc, con
     di<<"Usage : " << argv[0] << "\n";
     return -1;
   }
-  TColStd_Array2OfInteger Array2OfInteger(1,1,1,1);
-  Array2OfInteger.SetValue(5,5,55);
+
+  // check that exception initialized without message string can be safely handled and printed
+  try {
+    Standard_OutOfRange::Raise();
+  }
+  catch (Standard_Failure) {
+    std::cout << "Caught successfully: ";
+    Standard_Failure::Caught()->Print (std::cout);
+    std::cout << endl;
+  }
   return 0;
 }
 
index 41e28bc..41022bc 100755 (executable)
@@ -1,17 +1,11 @@
-# OK: Exception appears and does not kill DRAWEXE (TEST COMPLETED)
-puts "TODO OCC670 ALL: An exception was caught"
-puts "TODO OCC670 ALL: \\*\\* Exception \\*\\*"
-
 puts "========"
-puts "OCC670"
+puts "OCC670: Problem with the Print method."
 puts "========"
 puts ""
-#########################
-## Problem with the Print method.
-#########################
 
 pload QAcommands
 
-catch { OCC670 }
+# Check that exception is handled and does not kill DRAWEXE (TEST COMPLETED)
+OCC670
 
 puts "OCC670 OK"