DRAW commands stepwrite and brepiges modified to never ask for interactive input of file name or write mode; the behavior is completely defined by input arguments. String buffers causing access violation due to overflow are eliminated.
Test case bugs xde bug23561 added for this issue; TODO 23651 in related test cases removed.
Compiler warning (unrelated) is fixed in QABugs_11.cxx
TCollection_ExtendedString anExtString;
- Standard_ExtCharacter aNonAsciiChar = 0xff00;
+ Standard_ExtCharacter aNonAsciiChar = 0x0f00;
anExtString.Insert(1, aNonAsciiChar);
- di << "Is ASCII: " << ( anExtString.IsAscii() ? "true" : "false" ) << "\n";
+ di << "Is ASCII: " << ( anExtString.IsAscii() ? "true : Error" : "false : OK" ) << "\n";
NCollection_DataMap<TCollection_ExtendedString, Standard_Integer> aMap;
aMap.Bind(anExtString, 0);
// Mode d emploi (K4B ->) : brepiges shape [+shape][ +shape] nomfic
// c a d tant qu il y a des + on ajoute ce qui suit
- const char* ficnom = NULL;
+ const char* nomfic;
Standard_Integer npris = 0;
Handle(Draw_ProgressIndicator) progress = new Draw_ProgressIndicator ( di, 1 );
for ( Standard_Integer i = 1; i < n; i++) {
const char* nomvar = a[i];
if (a[i][0] == '+') nomvar = &(a[i])[1];
- else if (i > 1) { ficnom = a[i]; break; }
+ else if (i > 1) { nomfic = a[i]; break; }
TopoDS_Shape Shape = DBRep::Get(nomvar);
if (ICW.AddShape (Shape)) npris ++;
else if (ICW.AddGeom (DrawTrSurf::GetCurve (nomvar)) ) npris ++;
progress->Show();
di<<npris<<" Shapes written, giving "<<XSDRAW::Model()->NbEntities()<<" Entities"<<"\n";
- di<<" Now, to write a file, command : writeall filename"<<"\n";
- // creation du fichier de sortie
-
- char nomfic[100] ;
- Standard_Integer modepri = 0;
- if (ficnom) {
- modepri = 2;
- strcpy (nomfic,ficnom);
- }
-
- if (!modepri) {
- cout<<" Mode (0 End, 1 ->screen, 2 file) :"<<flush;
- modepri = -1;
- cin >> modepri; di << "Output mode " << modepri << "\n";
- }
-
- if (modepri == 0) return 0;
- // Ecran
- else if (modepri == 1) {
- di << " Screen Output" << "\n";
- //ICW.Write (cout);
- Standard_SStream aSStream;
- ICW.Write (aSStream);
- di << aSStream;
+ if ( ! nomfic ) // delayed write
+ {
+ di<<" Now, to write a file, command : writeall filename"<<"\n";
+ return 0;
}
- // .... WRITE (Fichier) ....
- else if (modepri == 2) {
- if (!ficnom) { cout << " Output file name :" << flush; cin >> nomfic; }
- di << " Output on file : " << nomfic << "\n";
- if (ICW.Write(nomfic)) di<<" Write OK"<<"\n";
- else di<<" Write KO"<<"\n";
- }
+ // write file
+ if (! ICW.Write(nomfic)) di<<" Error: could not write file " << nomfic;
+ else di<<" File " << nomfic << " written";
progress->EndScope();
progress->Show();
sw.WS()->TransferWriter()->FinderProcess()->SetProgress(progress);
Standard_Integer stat = sw.Transfer (shape,mode);
- di<<"execution status : "<<stat<<"\n";
+ if (stat == IFSelect_RetDone)
+ {
+ di << "Translation: OK\n";
+ }
+ else
+ {
+ di << "Error: translation failed, status = " << stat << "\n";
+ }
sw.WS()->TransferWriter()->FinderProcess()->SetProgress(0);
progress->EndScope();
if (nbapres <= nbavant) di<<"Beware : No data produced by this transfer"<<"\n";
if (nbapres == 0) { di<<"No data to write"<<"\n"; return 0; }
- char nomfic[150] ;
- Standard_Integer modepri = 1;
-
if (argc <= 3) {
- cout<<" Mode (0 end, 1 file) :"<<flush;
- cin >> modepri; di << "Output mode " << modepri << "\n";
- }
- else modepri = 2;
-
- if (modepri == 0) return 0;
- else if (modepri == 1) {
- cout << " Output file name :" << flush; cin >> nomfic;
+ di<<" Now, to write a file, command : writeall filename"<<"\n";
+ return 0;
}
- else if (modepri == 2) strcpy (nomfic,argv[3]);
- di << " Output on file : " << nomfic << "\n";
+ const char *nomfic = argv[3];
stat = sw.Write(nomfic);
switch (stat) {
- case IFSelect_RetVoid : di<<"No file written"<<"\n"; break;
+ case IFSelect_RetVoid : di<<"Error: No file written"<<"\n"; break;
case IFSelect_RetDone : di<<"File "<<nomfic<<" written"<<"\n"; break;
case IFSelect_RetStop : di<<"Error on writing file: no space on disk or destination is write protected"<<"\n"; break;
- default : di<<"File "<<nomfic<<" written with fail messages"<<"\n"; break;
+ default : di<<"Error: File "<<nomfic<<" written with fail messages"<<"\n"; break;
}
progress->EndScope();
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "=========="
puts "BUC60591"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "=================================="
puts "BUC60591"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "=================================="
puts "BUC60591"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "BUC60591"
puts ""
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "========================"
puts "BUC60948"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "================"
puts "OCC23379"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "================"
puts "OCC46"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "================"
puts "OCC51"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC184"
--- /dev/null
+# Test writing IGES or STEP file with long path
+
+puts "bug23561"
+
+pload MODELING
+
+# make path to log directory to be at least 200 symbols,
+# by adding ../xde/ as many times as needed
+set path [file normalize $imagedir]
+set last [file tail $path]
+while { [string length $path] < 200 } {
+ set path "$path/../$last"
+}
+
+# write simple box
+box b 10 10 10
+brepiges b "$path/${casename}.igs"
+stepwrite a b "$path/${casename}.stp"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC314"
set os $env(os_type)
-if { [string compare $os "windows"] == 0 } {
-# puts "TODO OCC23561 $os: child process exited abnormally"
-} else {
- puts "TODO OCC23561 ALL: An exception was caught"
- puts "TODO OCC23561 ALL: Tcl Exception:"
- puts "TODO OCC23561 ALL: \\*\\* Exception \\*\\*.*"
-}
-puts "TODO OCC23561 ALL: TEST INCOMPLETE"
puts "========"
puts "OCC321"