]> OCCT Git - occt.git/commitdiff
0029124: Visualization, Tests - failures when tests are executed via Remote Desktop...
authorabv <abv@opencascade.com>
Tue, 19 Sep 2017 10:04:23 +0000 (13:04 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 6 Oct 2017 07:28:30 +0000 (10:28 +0300)
Protection against accessing null pointer is added in OpenGl_VertexBuffer::Create().
In command vreadpixel OpenGl-related warnings are redirected to cout so that they do not contaminate the command output.
Test grid caf presentation is configured to ignore OpenGl-related warning messages.
Tests in grid tools are configured to report status SKIPPED if tools are not available (OCCT is built without Qt).

src/OpenGl/OpenGl_VertexBuffer.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/bugs/vis/bug22018
tests/caf/parse.rules
tests/tools/parse.rules

index 6bb3ca4b476cdd855fb9b65c43cf72580a037fea..560ccebd6647c963ca7f14bccd4a6064f873f1e8 100644 (file)
@@ -59,7 +59,7 @@ GLenum OpenGl_VertexBuffer::GetTarget() const
 // =======================================================================
 bool OpenGl_VertexBuffer::Create (const Handle(OpenGl_Context)& theGlCtx)
 {
-  if (myBufferId == NO_BUFFER)
+  if (myBufferId == NO_BUFFER && theGlCtx->core15fwd != NULL)
   {
     theGlCtx->core15fwd->glGenBuffers (1, &myBufferId);
   }
index 1f12147693e3a5d9b87336a75b310415d87f6ccb..4c7f7f2138ebf92d97ead083fd7d27f86db02ca5 100644 (file)
@@ -6022,6 +6022,16 @@ static int VReadPixel (Draw_Interpretor& theDI,
     return 1;
   }
 
+  // redirect possible warning messages that could have been added by ToPixMap
+  // into the Tcl interpretor (via DefaultMessenger) to cout, so that they do not
+  // contaminate result of the command
+  Standard_CString aWarnLog = theDI.Result();
+  if (aWarnLog != NULL && aWarnLog[0] != '\0')
+  {
+    std::cout << aWarnLog << std::endl;
+  }
+  theDI.Reset();
+
   Quantity_ColorRGBA aColor = anImage.PixelColor (anX, anY);
   if (toShowName)
   {
index 7ee4b7dfb96157e73048fb0993b2dda1bc30bf7f..2b92a3f8a5c0a33d0c0da02a016cf850930ddb2a 100755 (executable)
@@ -43,27 +43,27 @@ vmoveto 0 0
 vmoveto 0 0
 
 if { [vreadpixel $x1 $y rgb name] != "IVORY" || [vreadpixel $x2 $y rgb name] != "IVORY" } {
-  Error: unexpected color of not selected object
+  puts "Error: unexpected color of not selected object"
 }
 
 vmoveto ${x1} ${y}
 vmoveto ${x1} ${y}
 
 if { [vreadpixel $x1 $y rgb name] != "WHITE" } {
-  Error: unexpected color of selected object
+  puts "Error: unexpected color of selected object"
 }
 if { [vreadpixel $x2 $y rgb name] != "IVORY" } {
-  Error: unexpected color of not selected object
+  puts "Error: unexpected color of not selected object"
 }
 
 vmoveto ${x2} ${y}
 vmoveto ${x2} ${y}
 
 if { [vreadpixel $x1 $y rgb name] != "IVORY" } {
-  Error: unexpected color of not selected object
+  puts "Error: unexpected color of not selected object"
 }
 if { [vreadpixel $x2 $y rgb name] != "WHITE" } {
-  Error: unexpected color of selected object
+  puts "Error: unexpected color of selected object"
 }
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 9ee55b78eb29f0f4f77906651ea170e185d9927d..3a5fb94bd8572f9311f0f6afe64892f64b267b83 100755 (executable)
@@ -1,4 +1,5 @@
+IGNORE /on screen buffer is used for image dump - content might be invalid/ reported when software Microsoft OpenGL driver is used (remote desktop)
+IGNORE /^\s*DPrsStd_AISColor\s*:\s*Error\b/ ignore presentation K2 error message
 FAILED /\binvalid\b/ error
 FAILED /\bFailed\b/ error
 FAILED /\bfailed\b/ error
-IGNORE /^\s*DPrsStd_AISColor\s*:\s*Error\b/ ignore presentation K2 error message
index 95a93927e0d980d2beb378aae749997638b0e2db..396c2d9c2e6cb5dda56c1d863c0cb1641b267d35 100644 (file)
@@ -1,2 +1,3 @@
+SKIPPED /Draw_Failure: Could not open: TKToolsDraw/ OCCT built without Qt tools
 FAILED /\bFaulty\b/ bad shape
 OK /Relative error of mass computation/ message from vprops
\ No newline at end of file