X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=tests%2Fdemo%2Ftestsystem%2Ftestfile;h=043a562775adfba3f59ca7ac25f4c3d6b125648a;hb=8ee9c2f49a7c01dd1a364f02429f250555fbf29b;hpb=75744d9c23c7f7af477b4ec66df5d81e60b3ec63 diff --git a/tests/demo/testsystem/testfile b/tests/demo/testsystem/testfile new file mode 100644 index 0000000000..043a562775 --- /dev/null +++ b/tests/demo/testsystem/testfile @@ -0,0 +1,52 @@ +puts "# This test is for command testfile, used to check new data files " +puts "# before adding to the data base:" +puts "# - bottle.brep should be reported as already in data base" +puts "# - hammer_copy.igs should be reported as duplicate" +puts "# - square.brep should be reported as new, with warnings on DOS encoding" +puts "# and presence of triangulation" +puts "" + +puts "# Preparing test data files..." + +# find reference data files (they should be present, otherwise test is meaningless) +set bottle [locate_data_file bottle.brep] +set hammer [locate_data_file hammer.iges] + +# bottle is simply copied +file copy -force $bottle ${imagedir}/bottle.brep + +# hammer is copied with different name and DOS encoding +set fd [open $hammer r] +set hammer_content [read $fd] +close $fd +set fd [open ${imagedir}/_hammer_copy.igs w] +fconfigure $fd -translation crlf +puts -nonewline $fd $hammer_content +close $fd + +# square is created anew +pload MODELING +box b 11.1 11.1 11.1 +explode b f +tcopy b_1 f +incmesh f 0.01 +save f ${imagedir}/_square.brep + +set fd [open ${imagedir}/_square.brep r] +set square_content [read $fd] +close $fd +set fd [open ${imagedir}/_square.brep w] +fconfigure $fd -translation crlf +puts -nonewline $fd $square_content +close $fd + +puts "" +puts "REQUIRED ALL: bottle.brep: already present" +puts "REQUIRED ALL: hammer_copy.igs: duplicate" +puts "REQUIRED ALL: square.brep: new file" +puts "REQUIRED ALL: Warning: DOS encoding detected" +puts "REQUIRED ALL: Warning: shape contains triangulation" + +testfile [list ${imagedir}/bottle.brep ${imagedir}/_hammer_copy.igs ${imagedir}/_square.brep] + +puts "TEST COMPLETED" \ No newline at end of file