0023010: Error with a .stp model during transfer from STEPCAFControl_Reader to document
authorapv <apv@opencascade.com>
Thu, 31 Jul 2014 09:26:42 +0000 (13:26 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 31 Jul 2014 10:44:29 +0000 (14:44 +0400)
Adding test case

src/QABugs/QABugs_19.cxx
tests/bugs/xde/bug23010 [new file with mode: 0644]

index e108b6f..b4c9700 100755 (executable)
@@ -2640,6 +2640,46 @@ static Standard_Integer OCC24925 (Draw_Interpretor& theDI,
   return 0;
 }
 
+//=======================================================================
+//function : OCC23010
+//purpose  :
+//=======================================================================
+#include <STEPCAFControl_Reader.hxx>
+
+class mOcafApplication : public TDocStd_Application
+{
+  void Formats(TColStd_SequenceOfExtendedString& Formats)
+  {
+    Formats.Append(TCollection_ExtendedString("mOcafApplication"));
+  }
+  Standard_CString ResourcesName()
+  {
+    return Standard_CString("Resources");
+  }
+};
+
+static Standard_Integer OCC23010 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
+{
+  if (argc != 2) {
+    di << "Usage: " << argv[0] << " invalid number of arguments" << "\n";
+    return 1;
+  }
+  std::string fileName=argv[1];
+  mOcafApplication *mCasApp = new mOcafApplication();
+  Handle(TDocStd_Document) doc;
+  mCasApp->NewDocument("MDTV-XCAF", doc);
+  STEPCAFControl_Reader stepReader;
+  IFSelect_ReturnStatus status = stepReader.ReadFile (fileName.c_str());
+  if (status != IFSelect_RetDone)
+    return false;
+  stepReader.SetColorMode(Standard_True);
+  stepReader.SetLayerMode(Standard_True);
+  stepReader.SetNameMode(Standard_True);
+  stepReader.Transfer(doc); // ERROR HERE!!!
+  delete mCasApp;
+  return 0;
+}
+
 /*****************************************************************************/
 
 void QABugs::Commands_19(Draw_Interpretor& theCommands) {
@@ -2693,5 +2733,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
                    "OCC24925 filename [pluginLib=TKXml storageGuid retrievalGuid]"
                    "\nOCAF persistence without setting environment variables",
                    __FILE__, OCC24925, group);
+  theCommands.Add ("OCC23010", "OCC23010 STEP_file", __FILE__, OCC23010, group);
   return;
 }
diff --git a/tests/bugs/xde/bug23010 b/tests/bugs/xde/bug23010
new file mode 100644 (file)
index 0000000..d40aabd
--- /dev/null
@@ -0,0 +1,10 @@
+puts "============"
+puts "OCC23010"
+puts "============"
+puts ""
+##################################################################################
+# Error with a .stp model during transfer from STEPCAFControl_Reader to document
+##################################################################################
+
+pload QAcommands
+OCC23010 [locate_data_file occ23010.step]