From d326df24247f7321350a80f9713c39b4de1147ad Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 25 Jan 2026 21:58:44 +0100 Subject: [PATCH] Updating shape count output format and tests --- src/buddies/src/bd/strmxor.cc | 5 ++-- src/buddies/unit_tests/bdStrmxorTests.cc | 30 ++++++++++++------------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/buddies/src/bd/strmxor.cc b/src/buddies/src/bd/strmxor.cc index 0330eec48..c19dae98e 100644 --- a/src/buddies/src/bd/strmxor.cc +++ b/src/buddies/src/bd/strmxor.cc @@ -604,7 +604,8 @@ BD_PUBLIC int strmxor (int argc, char *argv[]) const char *line_format = " %-10s %-12s %s"; - std::string headline = tl::sprintf (line_format, tl::to_string (tr ("Layer")), tl::to_string (tr ("Output")), tl::to_string (tr ("Differences (shape count)"))); + std::string headline = tl::sprintf (line_format, tl::to_string (tr ("Layer")), tl::to_string (tr ("Output")), + deep ? tl::to_string (tr ("Differences (hierarchical/flat count)")) : tl::to_string (tr ("Differences (shape count)"))); const char *sep = " ----------------------------------------------------------------"; @@ -633,7 +634,7 @@ BD_PUBLIC int strmxor (int argc, char *argv[]) out = r->second.layout->get_properties (r->second.layer_output).to_string (); } if (deep) { - value = tl::sprintf (tl::to_string (tr ("%lu (hierarchical) %lu (flat)")), r->second.count (), r->second.flat_count ()); + value = tl::sprintf (tl::to_string (tr ("%-6lu / %-6lu")), r->second.count (), r->second.flat_count ()); } else { value = tl::to_string (r->second.count ()); } diff --git a/src/buddies/unit_tests/bdStrmxorTests.cc b/src/buddies/unit_tests/bdStrmxorTests.cc index bb06a9428..caec430a4 100644 --- a/src/buddies/unit_tests/bdStrmxorTests.cc +++ b/src/buddies/unit_tests/bdStrmxorTests.cc @@ -146,11 +146,11 @@ TEST(1A_Deep) "Layer 10/0 is not present in first layout, but in second\n" "Result summary (layers without differences are not shown):\n" "\n" - " Layer Output Differences (hierarchical shape count)\n" + " Layer Output Differences (hierarchical/flat count)\n" " ----------------------------------------------------------------\n" - " 3/0 3/0 3\n" - " 6/0 6/0 314\n" - " 8/1 8/1 1\n" + " 3/0 3/0 3 / 30 \n" + " 6/0 6/0 314 / 314 \n" + " 8/1 8/1 1 / 1 \n" " 10/0 - (no such layer in first layout)\n" "\n" ); @@ -188,11 +188,11 @@ TEST(1A_DeepNoEmptyCells) "Layer 10/0 is not present in first layout, but in second\n" "Result summary (layers without differences are not shown):\n" "\n" - " Layer Output Differences (hierarchical shape count)\n" + " Layer Output Differences (hierarchical/flat count)\n" " ----------------------------------------------------------------\n" - " 3/0 3/0 3\n" - " 6/0 6/0 314\n" - " 8/1 8/1 1\n" + " 3/0 3/0 3 / 30 \n" + " 6/0 6/0 314 / 314 \n" + " 8/1 8/1 1 / 1 \n" " 10/0 - (no such layer in first layout)\n" "\n" ); @@ -248,11 +248,11 @@ TEST(1B_Deep) "Layer 10/0 is not present in first layout, but in second\n" "Result summary (layers without differences are not shown):\n" "\n" - " Layer Output Differences (hierarchical shape count)\n" + " Layer Output Differences (hierarchical/flat count)\n" " ----------------------------------------------------------------\n" - " 3/0 - 3\n" - " 6/0 - 314\n" - " 8/1 - 1\n" + " 3/0 - 3 / 30 \n" + " 6/0 - 314 / 314 \n" + " 8/1 - 1 / 1 \n" " 10/0 - (no such layer in first layout)\n" "\n" ); @@ -830,10 +830,10 @@ TEST(7_OptimizeDeep) EXPECT_EQ (cap.captured_text (), "Result summary (layers without differences are not shown):\n" "\n" - " Layer Output Differences (hierarchical shape count)\n" + " Layer Output Differences (hierarchical/flat count)\n" " ----------------------------------------------------------------\n" - " 2/0 2/0 1\n" - " 3/0 3/0 8\n" + " 2/0 2/0 1 / 12 \n" + " 3/0 3/0 8 / 8 \n" "\n" ); }