mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0023452: Couldn't catch results produced by commands "data" and "tpstat"
Add new printer Improving of duplication of command's output Simplification of removing duplication of command's output Removing of brackets improved version Test correction
This commit is contained in:
parent
c7e8fd777c
commit
fa350ff051
@ -45,8 +45,9 @@ void Draw_Printer::Send (const TCollection_ExtendedString& theString,
|
||||
if ( ! myTcl )
|
||||
return;
|
||||
(*(Draw_Interpretor*)myTcl) << theString;
|
||||
if ( putEndl )
|
||||
(*(Draw_Interpretor*)myTcl) << '\n';
|
||||
if ( putEndl ){
|
||||
(*(Draw_Interpretor*)myTcl) << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@ -61,8 +62,9 @@ void Draw_Printer::Send (const Standard_CString theString,
|
||||
if ( ! myTcl )
|
||||
return;
|
||||
(*(Draw_Interpretor*)myTcl) << theString;
|
||||
if ( putEndl )
|
||||
(*(Draw_Interpretor*)myTcl) << '\n';
|
||||
if ( putEndl ){
|
||||
(*(Draw_Interpretor*)myTcl) << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@ -77,6 +79,7 @@ void Draw_Printer::Send (const TCollection_AsciiString& theString,
|
||||
if ( ! myTcl )
|
||||
return;
|
||||
(*(Draw_Interpretor*)myTcl) << theString;
|
||||
if ( putEndl )
|
||||
(*(Draw_Interpretor*)myTcl) << '\n';
|
||||
if ( putEndl ){
|
||||
(*(Draw_Interpretor*)myTcl) << "\n";
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ package XSDRAW
|
||||
|
||||
uses TCollection, TColStd, TopTools,
|
||||
gp, Geom, Geom2d, TopoDS, MoniTool,
|
||||
Interface, Transfer, IFSelect, XSControl, Draw, SWDRAW
|
||||
Interface, Transfer, IFSelect, XSControl, Draw, SWDRAW, Message
|
||||
|
||||
is
|
||||
|
||||
|
@ -39,6 +39,8 @@
|
||||
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Message_PrinterOStream.hxx>
|
||||
#include <Draw_Printer.hxx>
|
||||
|
||||
static int deja = 0, dejald = 0;
|
||||
//unused variable
|
||||
@ -109,6 +111,11 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands)
|
||||
// performed not in IFSelect_SessionPilot but in standard Tcl interpretor
|
||||
XSDRAW::RemoveCommand("x");
|
||||
XSDRAW::RemoveCommand("exit");
|
||||
const Handle(Message_Messenger) &sout = Message::DefaultMessenger();
|
||||
if (!sout.IsNull()){
|
||||
sout->RemovePrinters(STANDARD_TYPE(Message_PrinterOStream));
|
||||
sout->AddPrinter(new Draw_Printer(theCommands));
|
||||
}
|
||||
// if (!getenv("WBHOSTTOP")) XSDRAW::RemoveCommand("xsnew");
|
||||
Handle(TColStd_HSequenceOfAsciiString) list =
|
||||
IFSelect_Activator::Commands(0);
|
||||
|
24
tests/bugs/iges/buc60685
Normal file → Executable file
24
tests/bugs/iges/buc60685
Normal file → Executable file
@ -10,21 +10,15 @@ set l [igesbrep [locate_data_file buc60685a.igs] a xst-transferrable-roots]
|
||||
tpcompound result
|
||||
puts [checkshape result r]
|
||||
|
||||
set start [lindex $l 60]
|
||||
set bug_list_numb [ llength $l ]
|
||||
set bug_list_elem 0
|
||||
while { $bug_list_elem != $bug_list_numb } {
|
||||
if { [ string compare "Nb" [ lindex $l $bug_list_elem ] ] == 0 && [ string compare "entities" [ lindex $l [ expr { $bug_list_elem + 1 } ] ] ] == 0 && [ string compare "selected" [ lindex $l [ expr { $bug_list_elem + 2 } ] ] ] == 0 && [ string compare ":" [ lindex $l [ expr { $bug_list_elem + 3 } ] ] ] == 0 } {
|
||||
set start [ lindex $l [ expr { $bug_list_elem + 4 } ] ]
|
||||
set bug_list_elem [ expr { $bug_list_numb - 1 } ]
|
||||
}
|
||||
set bug_list_elem [ expr { $bug_list_elem + 1 } ]
|
||||
}
|
||||
|
||||
set n [llength $l]
|
||||
set end [lindex $l [expr $n-1]]
|
||||
if { $start != $end } {
|
||||
puts "Error : wrong number of translated shapes. It is ${end} instead of ${start}"
|
||||
regexp {List given by xst-transferrable-roots : Nb entities selected : +([-0-9+eE]+)} ${l} full start
|
||||
regexp {List given by xst-transferrable-roots : Nb entities selected : +([-0-9+eE]+)} ${l} full end
|
||||
puts "start = ${start}"
|
||||
puts "end = ${end}"
|
||||
if { ${start} == ${end} && ${start} == 19 } {
|
||||
puts "BUC60685: OK"
|
||||
} else {
|
||||
puts "Faulty : wrong number of translated shapes. It is ${end} instead of ${start}"
|
||||
puts "BUC60685: Faulty"
|
||||
}
|
||||
|
||||
set 2dviewer 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user