From d958d71e2e0ea68d01b7c0bf3d8aefc0fed63ab4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 5 Aug 2023 21:02:26 +0200 Subject: [PATCH] Fixed unit tests and MSVC build --- src/db/db/dbPath.cc | 4 ++-- src/db/db/dbText.cc | 12 ++++++------ src/db/unit_tests/dbLayoutDiffTests.cc | 14 +++++++------- testdata/ruby/dbShapesTest.rb | 4 ++-- testdata/ruby/dbTextTest.rb | 20 ++++++++++---------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/db/db/dbPath.cc b/src/db/db/dbPath.cc index d41509af1..5f63d7de5 100644 --- a/src/db/db/dbPath.cc +++ b/src/db/db/dbPath.cc @@ -579,8 +579,8 @@ Path round_path_corners (const Path &path, int rad, int n) return Path (round_path_corners (db::DPath (path), double (rad), n, 0.5)); } -template class path; -template class path; +template class DB_PUBLIC path; +template class DB_PUBLIC path; // explicit instantiations template DB_PUBLIC void path::create_shifted_points (Coord, Coord, Coord, bool, path::pointlist_type::iterator, path::pointlist_type::iterator, int, box_inserter::box_type>) const; diff --git a/src/db/db/dbText.cc b/src/db/db/dbText.cc index cde5c7f34..1a5780906 100644 --- a/src/db/db/dbText.cc +++ b/src/db/db/dbText.cc @@ -121,22 +121,22 @@ std::string text::to_string (double dbu) const return s; } -template class text; -template class text; +template class DB_PUBLIC text; +template class DB_PUBLIC text; } namespace tl { -template<> void extractor_impl (tl::Extractor &ex, db::Text &p) +template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::Text &p) { if (! test_extractor_impl (ex, p)) { ex.error (tl::to_string (tr ("Expected a text specification"))); } } -template<> void extractor_impl (tl::Extractor &ex, db::DText &p) +template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::DText &p) { if (! test_extractor_impl (ex, p)) { ex.error (tl::to_string (tr ("Expected a text specification"))); @@ -189,12 +189,12 @@ template bool _test_extractor_impl (tl::Extractor &ex, db::text &t) } } -template<> bool test_extractor_impl (tl::Extractor &ex, db::Text &p) +template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::Text &p) { return _test_extractor_impl (ex, p); } -template<> bool test_extractor_impl (tl::Extractor &ex, db::DText &p) +template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::DText &p) { return _test_extractor_impl (ex, p); } diff --git a/src/db/unit_tests/dbLayoutDiffTests.cc b/src/db/unit_tests/dbLayoutDiffTests.cc index 739b9a77d..cedee284d 100644 --- a/src/db/unit_tests/dbLayoutDiffTests.cc +++ b/src/db/unit_tests/dbLayoutDiffTests.cc @@ -1167,7 +1167,7 @@ TEST(5) EXPECT_EQ (r.text (), "layout_diff: texts differ for layer 17/0 in cell c2x\n" "Not in b but in a:\n" - " ('X',r90 2,3)\n" + " ('X',r90 2,3) s=17\n" "Not in a but in b:\n" ); @@ -1198,10 +1198,10 @@ TEST(5) "layout_diff: texts differ for layer 17/0 in cell c2x\n" "Not in b but in a:\n" "Not in a but in b:\n" - " ('X',r90 2,3)\n" - " ('Y',r90 2,3)\n" - " ('X',r90 3,4)\n" - " ('X',r180 2,3)\n" + " ('X',r90 2,3) s=18\n" + " ('Y',r90 2,3) s=17\n" + " ('X',r90 3,4) s=17\n" + " ('X',r180 2,3) s=17\n" ); // two more to match more of h: @@ -1216,8 +1216,8 @@ TEST(5) "layout_diff: texts differ for layer 17/0 in cell c2x\n" "Not in b but in a:\n" "Not in a but in b:\n" - " ('Y',r90 2,3)\n" - " ('X',r180 2,3)\n" + " ('Y',r90 2,3) s=17\n" + " ('X',r180 2,3) s=17\n" ); } diff --git a/testdata/ruby/dbShapesTest.rb b/testdata/ruby/dbShapesTest.rb index a55ffa4f8..3b6f9b7a2 100644 --- a/testdata/ruby/dbShapesTest.rb +++ b/testdata/ruby/dbShapesTest.rb @@ -1102,7 +1102,7 @@ class DBShapes_TestClass < TestBase arr = [] shapes.each( RBA::Shapes::SAll ) { |s| arr.push( s.to_s ) } - assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) prop_id=1"] ) + assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) f=3 ha=c va=b prop_id=1"] ) assert_equal( s1.is_valid?, true ) assert_equal( s1.shapes.is_valid?(s1), true ) @@ -1316,7 +1316,7 @@ class DBShapes_TestClass < TestBase arr = [] shapes.each( RBA::Shapes::SAll ) { |s| arr.push( s.to_s ) } - assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) prop_id=1"] ) + assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) f=3 ha=c va=b prop_id=1"] ) assert_equal( s1.is_valid?, true ) assert_equal( s1.shapes.is_valid?(s1), true ) diff --git a/testdata/ruby/dbTextTest.rb b/testdata/ruby/dbTextTest.rb index 44f210a73..55610d279 100644 --- a/testdata/ruby/dbTextTest.rb +++ b/testdata/ruby/dbTextTest.rb @@ -102,20 +102,20 @@ class DBText_TestClass < TestBase b = a.dup - assert_equal( a.moved( RBA::DPoint::new( 0, 1 ) ).to_s, "('hallo',m45 5,8)" ) + assert_equal( a.moved( RBA::DPoint::new( 0, 1 ) ).to_s, "('hallo',m45 5,8) s=23 f=8 ha=r va=b" ) a.move( RBA::DPoint::new( 1, 0 ) ) - assert_equal( a.to_s, "('hallo',m45 6,7)" ) + assert_equal( a.to_s, "('hallo',m45 6,7) s=23 f=8 ha=r va=b" ) b = b.transformed( RBA::DTrans::new( RBA::DTrans::R0, RBA::DPoint::new( 1, 0 )) ) - assert_equal( b.to_s, "('hallo',m45 6,7)" ) + assert_equal( b.to_s, "('hallo',m45 6,7) s=23 f=8 ha=r va=b" ) m = RBA::DCplxTrans::new( RBA::DTrans::new, 1.5 ) assert_equal( a.transformed(m).class.to_s, "RBA::DText" ) - assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5)" ) + assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5) s=34.5 f=8 ha=r va=b" ) m = RBA::VCplxTrans::new( 1000.0 ) assert_equal( a.transformed(m).class.to_s, "RBA::Text" ) - assert_equal( a.transformed(m).to_s, "('hallo',m45 6000,7000)" ) + assert_equal( a.transformed(m).to_s, "('hallo',m45 6000,7000) s=23000 f=8 ha=r va=b" ) end @@ -196,16 +196,16 @@ class DBText_TestClass < TestBase b = a.dup - assert_equal( a.moved( RBA::Point::new( 0, 1 ) ).to_s, "('hallo',m45 5,8)" ) + assert_equal( a.moved( RBA::Point::new( 0, 1 ) ).to_s, "('hallo',m45 5,8) s=23 f=8 ha=l va=t" ) a.move( RBA::Point::new( 1, 0 ) ) - assert_equal( a.to_s, "('hallo',m45 6,7)" ) + assert_equal( a.to_s, "('hallo',m45 6,7) s=23 f=8 ha=l va=t" ) b = b.transformed( RBA::Trans::new( RBA::Trans::R0, RBA::Point::new( 1, 0 )) ) - assert_equal( b.to_s, "('hallo',m45 6,7)" ) + assert_equal( b.to_s, "('hallo',m45 6,7) s=23 f=8 ha=l va=t" ) m = RBA::CplxTrans::new( RBA::Trans::new, 1.5 ) - assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5)" ) - assert_equal( a.transformed(RBA::ICplxTrans::new(m)).to_s, "('hallo',m45 9,11)" ) + assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5) s=34.5 f=8 ha=l va=t" ) + assert_equal( a.transformed(RBA::ICplxTrans::new(m)).to_s, "('hallo',m45 9,11) s=35 f=8 ha=l va=t" ) end