1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023010: Error with a .stp model during transfer from STEPCAFControl_Reader to document

Adding test case
This commit is contained in:
apv 2014-07-31 13:26:42 +04:00 committed by bugmaster
parent 870722965d
commit e4b5c45aa6
2 changed files with 51 additions and 0 deletions

View File

@ -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;
}

10
tests/bugs/xde/bug23010 Normal file
View File

@ -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]