From 5879dab46b16761844ec2175b3e7392d12541f60 Mon Sep 17 00:00:00 2001 From: apn Date: Fri, 26 Apr 2013 15:33:30 +0400 Subject: [PATCH] 0023916: Test artifacts in current directory Improvements to prevent producing artifacts (files) in current directory Modified QA command OCC7141 to save file in specific location --- src/QABugs/QABugs_11.cxx | 15 ++++++++++----- src/QABugs/QABugs_19.cxx | 1 - tests/bugs/iges/bug22820 | 8 +++----- tests/bugs/vis/bug23226 | 4 ++-- tests/bugs/xde/bug7141 | 3 ++- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx index 7a49d90098..1f73e0055f 100755 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -2702,14 +2702,15 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co { int nCount = 10; - if (argc > 2) + if (argc > 3) { - di << "Usage : " << argv[0] << " [nCount]" << "\n"; + di << "Usage : " << argv[0] << " [nCount] path" << "\n"; return 1; } - if (argc > 1) + if (argc > 2) nCount = Draw::Atoi(argv[1]); + TCollection_AsciiString aFilePath = argv[2]; STEPCAFControl_Writer writer; Handle_TDocStd_Document document; document = new TDocStd_Document("Pace Test-StepExporter-"); @@ -2725,7 +2726,7 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co OCC_CATCH_SIGNALS if( writer.Transfer(document, mode)) { IFSelect_ReturnStatus stat = - writer.Write("TestExportStructure.step"); + writer.Write(aFilePath.ToCString()); } } catch(OSD_Exception_STACK_OVERFLOW) { @@ -2738,6 +2739,10 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co } di << argv[0] << " : Finish" << "\n"; + if( remove("TestExportStructure.step") != 0 ) { + perror( "Error deleting file" ); + } + return 0; } @@ -5417,7 +5422,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC6046", "OCC6046 nb_of_vectors size", __FILE__, OCC6046, group); theCommands.Add("OCC5698", "OCC5698 wire", __FILE__, OCC5698, group); theCommands.Add("OCC6143", "OCC6143", __FILE__, OCC6143, group); - theCommands.Add("OCC7141", "OCC7141 [nCount]", __FILE__, OCC7141, group); + theCommands.Add("OCC7141", "OCC7141 [nCount] aPath", __FILE__, OCC7141, group); theCommands.Add("OCC7372", "OCC7372", __FILE__, OCC7372, group); theCommands.Add("OCC8169", "OCC8169 edge1 edge2 plane", __FILE__, OCC8169, group); theCommands.Add("OCC10138", "OCC10138 lower upper", __FILE__, OCC10138, group); diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index fc1b7d1675..595a9a77eb 100755 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -344,7 +344,6 @@ Standard_Boolean static OCC23774Test(const TopoDS_Face& grossPlateFace, const To return Standard_False; } const TopoDS_Shape& step2ModifiedShape = transformer1.ModifiedShape(step1ModifiedShape); - BRepTools::Write(step2ModifiedShape, Standard_CString ("SecondMirrorWire.brep")); //This is identity matrix for values but for type is gp_Rotation ?! gp_Trsf2d mirror11 = mirror1; diff --git a/tests/bugs/iges/bug22820 b/tests/bugs/iges/bug22820 index 116054e73d..6fac82cdb8 100755 --- a/tests/bugs/iges/bug22820 +++ b/tests/bugs/iges/bug22820 @@ -6,16 +6,14 @@ puts "" # OCCT IGES writer loses plane information ###################################################################################### -pload XDE - box b 1 1 1 set b_info [dump b] if { [regexp BSplineSurface ${b_info}] } { puts "Error in dump b" } -brepiges b 0 -igesbrep . bb * +brepiges b ${imagedir}/22820.igs +igesbrep ${imagedir}/22820.igs bb * set types_info [listtypes] puts "types_info=${types_info}" @@ -23,7 +21,7 @@ if { [regexp BSplineSurface ${types_info}] } { puts "Error in listtypes" } -igesbrep . bb * +igesbrep ${imagedir}/22820.igs bb * set bb_info [dump bb] if { [regexp BSplineSurface ${bb_info}] } { puts "Error in dump bb" diff --git a/tests/bugs/vis/bug23226 b/tests/bugs/vis/bug23226 index 0831050b8e..de73740f54 100755 --- a/tests/bugs/vis/bug23226 +++ b/tests/bugs/vis/bug23226 @@ -325,8 +325,8 @@ for {set vbo_enable 0} {$vbo_enable < 2} {incr vbo_enable} { vfit # dump resulted image - if { $vbo_enable == 0 } { vfeedback; vdump $ImageName1 } - if { $vbo_enable == 1 } { vfeedback; vdump $ImageName2 } + if { $vbo_enable == 0 } { vfeedback; vdump ${imagedir}/$ImageName1 } + if { $vbo_enable == 1 } { vfeedback; vdump ${imagedir}/$ImageName2 } } diff --git a/tests/bugs/xde/bug7141 b/tests/bugs/xde/bug7141 index fa13b909ce..1d8b40e97e 100755 --- a/tests/bugs/xde/bug7141 +++ b/tests/bugs/xde/bug7141 @@ -10,8 +10,9 @@ pload QAcommands set BugNumber OCC7141 +file delete ${imagedir}/TestExportStructure.step set nCount 20 -if [catch { set List [OCC7141 ${nCount}] } result] { +if [catch { set List [OCC7141 ${nCount} ${imagedir}/TestExportStructure.step] } result] { puts "${BugNumber}: Faulty" } else { puts "${BugNumber}: OK"