From a50fadffcd5662f0fc93da400a832ae0a4023f15 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 17 Sep 2019 23:10:41 +0200 Subject: [PATCH] Fixed #358 (strm2oas was producing GDS) --- src/buddies/src/bd/strm2oas.cc | 2 +- testdata/buddies/buddies.rb | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/buddies/src/bd/strm2oas.cc b/src/buddies/src/bd/strm2oas.cc index 9fe00c482..90a543ef1 100644 --- a/src/buddies/src/bd/strm2oas.cc +++ b/src/buddies/src/bd/strm2oas.cc @@ -25,5 +25,5 @@ BD_PUBLIC int strm2oas (int argc, char *argv[]) { - return bd::converter_main (argc, argv, bd::GenericWriterOptions::gds2_format_name); + return bd::converter_main (argc, argv, bd::GenericWriterOptions::oasis_format_name); } diff --git a/testdata/buddies/buddies.rb b/testdata/buddies/buddies.rb index 46dcf6e5d..2cdfbbb7f 100644 --- a/testdata/buddies/buddies.rb +++ b/testdata/buddies/buddies.rb @@ -47,11 +47,20 @@ class Buddies_TestClass < TestBase def test_converters + signatures = { + "strm2cif" => 0x28434946, + "strm2dxf" => 0x300a5345, + "strm2gds" => 0x00060002, + "strm2gdstxt" => 0x48454144, + "strm2oas" => 0x2553454d, + "strm2txt" => 0x62656769, + } + %w(strm2cif strm2dxf strm2gds strm2gdstxt strm2oas strm2txt).each do |bin| puts "Testing #{bin} ..." - out_file = File.join($ut_testtmp, "out") + out_file = File.join($ut_testtmp, "out_" + bin) if File.exists?(out_file) File.unlink(out_file) end @@ -63,6 +72,11 @@ class Buddies_TestClass < TestBase assert_equal(File.exists?(out_file), true) assert_equal(log, bin + "\n") + File.open(out_file, "rb") do |file| + sig = file.read(4).unpack('N').first + assert_equal(sig, signatures[bin]) + end + end end