mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0025740: VrmlData_Scene::WriteArrIndex() writes extra point indices.
Reason of bug: at the end of writing indices the "buf" was written double times. Fix: At the end of operation skip one WriteLine. Test case for issue CR25740
This commit is contained in:
parent
f5fa6b335c
commit
0bb1f1133c
@ -898,6 +898,8 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteArrIndex
|
||||
char * ptr = &buf[0];
|
||||
for (Standard_Integer i = 0; i < nVal; i++) {
|
||||
Sprintf (ptr, "%d,", arrVal[i]);
|
||||
if (i == nVal - 1)
|
||||
break;
|
||||
ptr = strchr (ptr, ',') + 1;
|
||||
if ((ptr - &buf[0]) > (ptrdiff_t)aLineLimit) {
|
||||
WriteLine(buf);
|
||||
|
43
tests/bugs/stlvrml/bug25740
Normal file
43
tests/bugs/stlvrml/bug25740
Normal file
@ -0,0 +1,43 @@
|
||||
puts "================"
|
||||
puts "OCC25740"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################################
|
||||
# VrmlData_Scene::WriteArrIndex() writes extra point indices
|
||||
#######################################################################################
|
||||
|
||||
set BugNumber OCC25740
|
||||
|
||||
set aFile $imagedir/${test_image}.vrml
|
||||
|
||||
ptorus p 10 8 0 90 120
|
||||
incmesh p 0.1
|
||||
|
||||
explode p e
|
||||
|
||||
storevrml p_3 ${aFile} 1 1
|
||||
|
||||
set status 1
|
||||
if { ![file exists ${aFile}] } {
|
||||
set status 0
|
||||
}
|
||||
|
||||
# Check file size
|
||||
set filesize [ file size ${aFile} ]
|
||||
if { ${filesize} == 0 } {
|
||||
set status 0
|
||||
}
|
||||
|
||||
set fd0 [ open ${aFile} r ]
|
||||
set filecontent [ read ${fd0} ]
|
||||
close $fd0
|
||||
|
||||
if { ![regexp {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,\n\s+16,17,18,19,20,21,22,23,24,25,26,27,28, -1} ${filecontent} full] } {
|
||||
set status 0
|
||||
}
|
||||
|
||||
if {$status == 1} {
|
||||
puts "OK ${BugNumber}"
|
||||
} else {
|
||||
puts "Faulty ${BugNumber}"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user