From cfa9494ffcefb6ecbdf0afa0ebe2d4af7d6fa8ab Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 3 Dec 2023 17:08:37 -0500 Subject: [PATCH] fix broken columns --- src/blt/profiling/profiler.cpp | 12 ++++++------ src/blt/profiling/profiler_v2.cpp | 12 ++++++------ tests/src/utility_test.cpp | 16 ++++++++++++---- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/blt/profiling/profiler.cpp b/src/blt/profiling/profiler.cpp index 5ee5810..2a684ef 100755 --- a/src/blt/profiling/profiler.cpp +++ b/src/blt/profiling/profiler.cpp @@ -123,12 +123,12 @@ namespace blt::profiling { orderIntervals(averageHistory ? averaged_intervals : intervals, ordered_rows, averageHistory); string::TableFormatter formatter{profileName}; - formatter.addColumn({"Order"}); - formatter.addColumn({"Count"}); - formatter.addColumn({"Interval"}); - formatter.addColumn({"Time (ms)"}); - formatter.addColumn({"Time (ns)"}); - formatter.addColumn({"Total (ms)"}); + formatter.addColumn("Order"); + formatter.addColumn("Count"); + formatter.addColumn("Interval"); + formatter.addColumn("Time (ms)"); + formatter.addColumn("Time (ns)"); + formatter.addColumn("Total (ms)"); int index = 1; for (const auto& row : ordered_rows) { diff --git a/src/blt/profiling/profiler_v2.cpp b/src/blt/profiling/profiler_v2.cpp index d2b410f..cf191a0 100644 --- a/src/blt/profiling/profiler_v2.cpp +++ b/src/blt/profiling/profiler_v2.cpp @@ -164,16 +164,16 @@ namespace blt auto wall_unit_divide = units.wall == unit::MS ? 1e6 : units.wall == unit::NS ? 1 : 1e9; string::TableFormatter formatter{profiler.name}; - formatter.addColumn({"Order"}); + formatter.addColumn("Order"); if (printHistory) - formatter.addColumn({"Count"}); - formatter.addColumn({"Interval"}); + formatter.addColumn("Count"); + formatter.addColumn("Interval"); if (printCycles) - formatter.addColumn({"Cycles"}); + formatter.addColumn("Cycles"); if (printThread) - formatter.addColumn({"CPU Time (" + thread_unit_string += ")"}); + formatter.addColumn("CPU Time (" + thread_unit_string += ")"); if (printWall) - formatter.addColumn({"Wall Time (" + wall_unit_string += ")"}); + formatter.addColumn("Wall Time (" + wall_unit_string += ")"); for (size_t i = 0; i < profiler.intervals.size(); i++) { diff --git a/tests/src/utility_test.cpp b/tests/src/utility_test.cpp index 1369c49..9df9827 100644 --- a/tests/src/utility_test.cpp +++ b/tests/src/utility_test.cpp @@ -45,8 +45,8 @@ void blt::test::utility::run() } blt::string::TableFormatter tableTest("Intrinsic Action Value Table"); - tableTest.addColumn({"Thing"}); - tableTest.addColumn({"Value"}); + tableTest.addColumn("Thing"); + tableTest.addColumn("Value"); tableTest.addRow({"Cuddles", "1 / minute"}); tableTest.addRow({"Hand Job", "10"}); @@ -85,9 +85,17 @@ void blt::test::utility::run() ); printLines(assign1.construct()); - blt::string::TableFormatter tableQ2i1("Iteration 1"); - tableQ2i1.addColumn("Statement"); + blt::string::TableFormatter tableQ2i1("Iteration 0"); tableQ2i1.addColumn("Statement"); + tableQ2i1.addColumn("IN"); + tableQ2i1.addColumn("OUT"); + tableQ2i1.addRow({"Entry (0)", "{}", "{}"}); + tableQ2i1.addRow({"(1)", "{}", "{}"}); + tableQ2i1.addRow({"(2)", "{}", "{}"}); + tableQ2i1.addRow({"(3)", "{}", "{}"}); + tableQ2i1.addRow({"(4)", "{}", "{}"}); + tableQ2i1.addRow({"(5)", "{}", "{}"}); + tableQ2i1.addRow({"Exit (6)", "{}", "{}"}); printLines(tableQ2i1.createTable(true, true)); }