Unit test and additional parsing rule for tests are added as well as a minor fix of the draw command for bug24164_2 unit test (in reference array it was impossible to set only one value).
Added the exception for the checking in issue 2269, when bad document is read.
It checks that there is no crash, but just an error message. If crash is appeared, this test will not skipped anyway.
Correction of test for bug2269 and parse.rules
(cherry picked from commit
6d1e872b4da9f518621ece8d043b6f6fa484ef5b)
theSource >> aNbShapes;
TDF_Label aLabel = theTarget->Label ();
TNaming_Builder aBuilder (aLabel);
- if (aNbShapes == 0) return Standard_False;
Standard_Integer aVer;
Standard_Boolean ok = theSource >> aVer;
if(!ok) return Standard_False;
for (TNaming_Iterator SItr (aSAtt); SItr.More (); SItr.Next ()) NbShapes++;
//--------------------------------------------------------------
- if (NbShapes == 0) return;
-
BinTools_ShapeSet& aShapeSet = (BinTools_ShapeSet&) myShapeSet;
TNaming_Evolution anEvol = aSAtt->Evolution();
else
theIS.seekg(aPos); // no shape section is present, try to return to initial point
}
-
Handle(TDataStd_ReferenceArray) A = TDataStd_ReferenceArray::Set(label, From, To);
- if (nb > 6) {
+ if (nb >= 6) {
j = 5;
for(Standard_Integer i = From; i<=To; i++) {
TDF_Label aRefLabel;
static Standard_Integer BuildNamedShape (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg) {
- if (nb > 4) {
+ if (nb >= 4) {
TDF_Label aLabel;
if (!QADNaming::Entry(arg, aLabel)) return 1;
char anEvolution = arg[3][0];
// OnlyModif = Draw::Atoi(arg[3]);
// }
} else {
- di<<"Usage: BuildName df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) shape1 [shape2 ...]\n";
+ di<<"Usage: BuildName df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) [shape1 shape2 ...]\n";
return 1;
}
return 0;
const char* g = "Naming builder commands";
theCommands.Add("BuildNamedShape",
- "BuildNamedShape df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) shape1 [shape2 ...]",
+ "BuildNamedShape df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) [shape1 shape2 ...]",
__FILE__,BuildNamedShape,g);
}
+puts "REQUIRED All: XmlDriver warning: failure reading attribute TDataStd_RealArray"
+
puts "================"
puts "OCC2269"
puts "================"
--- /dev/null
+puts "==========="
+puts "OCC28428"
+puts "==========="
+puts ""
+########################################################################
+# BinMNaming_NamedShapeDriver fails if there are no nodes in NamedShape
+########################################################################
+
+pload QAcommands
+
+NewDocument D1 BinOcaf
+# Create TNaming_Builder on a label without putthing shapes
+BuildNamedShape D1 0:1 P
+SaveAs D1 $imagedir/bug28428_new.cbf
+Close D1
+# This produced a NamedShape driver failure with catching by general driver
+# and output a failure message (catched by parse.rules)
+Open $imagedir/bug28428_new.cbf D2
+Close D2
FAILED /\bFaulty\b/ bad shape
+FAILED /failure reading attribute/ attribute failure
SKIPPED /Error: unsupported locale specification/ locale is unavailable on tested system
-OK /Relative error of mass computation/ message from vprops
\ No newline at end of file
+OK /Relative error of mass computation/ message from vprops