What would you like?
Unit tests for the plot-parameter classes in src/visualization/plot_parameters.cpp /
include/visualization/plot_parameters.h. These are pure-logic value types with a clean,
GUI-free API and currently have no dedicated test, so they're an easy coverage win.
Cover:
PlotDimensions
isLegal() — true for valid ranges/steps; false when xMin >= xMax, yMin >= yMax,
or any step is non-positive.
toString() — expected formatted text (uses std::format with {:.2f}).
operator== — equal vs. each field differing.
PlotAnnotations — toString() and operator== (title / x_label / y_label).
PlotCommonParameters — toString() and operator== (type + nested dimensions +
annotations).
Use case / motivation
Overall coverage is ~47%. The visualization/ folder is mostly ImGui rendering (heatmap,
lineplot, plot, visualization) that isn't unit-testable, but plot_parameters is the one
self-contained logic unit in that folder — testing it lifts coverage without needing a render
context.
What's missing today?
There is no tests/visualization/ test file. PlotDimensions::isLegal(), the three
toString() methods, and the three operator== overloads are entirely uncovered.
Possible approach
- Add
tests/visualization/test_plot_parameters.cpp and register it in tests/CMakeLists.txt
(follow how the existing element tests are registered).
- One
TEST(...) per behaviour. Example:
TEST(PlotDimensionsTest, IsLegal)
{
EXPECT_TRUE (PlotDimensions(0.0, 100.0, -5.0, 5.0, 1.0, 1.0).isLegal());
EXPECT_FALSE(PlotDimensions(100.0, 0.0, -5.0, 5.0, 1.0, 1.0).isLegal()); // xMin>=xMax
EXPECT_FALSE(PlotDimensions(0.0, 100.0, -5.0, 5.0, 0.0, 1.0).isLegal()); // step<=0
}
Verifiable end state: new test_plot_parameters.cpp passes and coverage for
src/visualization/plot_parameters.cpp rises. The ImGui rendering files in src/visualization/
and src/user_interface/ are intentionally out of scope.
What would you like?
Unit tests for the plot-parameter classes in
src/visualization/plot_parameters.cpp/include/visualization/plot_parameters.h. These are pure-logic value types with a clean,GUI-free API and currently have no dedicated test, so they're an easy coverage win.
Cover:
PlotDimensionsisLegal()—truefor valid ranges/steps;falsewhenxMin >= xMax,yMin >= yMax,or any step is non-positive.
toString()— expected formatted text (usesstd::formatwith{:.2f}).operator==— equal vs. each field differing.PlotAnnotations—toString()andoperator==(title / x_label / y_label).PlotCommonParameters—toString()andoperator==(type + nested dimensions +annotations).
Use case / motivation
Overall coverage is ~47%. The
visualization/folder is mostly ImGui rendering (heatmap,lineplot, plot, visualization) that isn't unit-testable, but
plot_parametersis the oneself-contained logic unit in that folder — testing it lifts coverage without needing a render
context.
What's missing today?
There is no
tests/visualization/test file.PlotDimensions::isLegal(), the threetoString()methods, and the threeoperator==overloads are entirely uncovered.Possible approach
tests/visualization/test_plot_parameters.cppand register it intests/CMakeLists.txt(follow how the existing element tests are registered).
TEST(...)per behaviour. Example:Verifiable end state: new
test_plot_parameters.cpppasses and coverage forsrc/visualization/plot_parameters.cpprises. The ImGui rendering files insrc/visualization/and
src/user_interface/are intentionally out of scope.