Skip to content

settings_dialog_test.cpp

file tests/app/settings_dialog_test.cpp ยท Test suite

Tests of nmeasim::app::SettingsDialog, the profile editor of the desktop application.

Source tests/app/settings_dialog_test.cpp

Covers loading a profile into the simulation, sentences, outputs and vessel tabs and storing the edited values back: simulation values and the destination, the simulation mode and its files, per-sentence settings that differ from the registry, custom sentences, outputs with their transports and encodings, engines and AIS static data. It also checks that invalid input keeps the dialog open on the tab concerned with an error text, that an edited profile round-trips through JSON, and that nmeasim::app::MainWindow takes the dialog result as its profile, and that values an unchanged dialog cannot show exactly (the whole random seed range, coordinates with more than six decimals, output settings outside the old widget ranges) survive OK, and where the file dialogs of the Browse... buttons start for a path relative to the profile's directory. The dialogs are never shown; accept is called directly. The file reads no fixtures.

Test cases

15 test cases, in source order.

Test case Tags
the settings dialog loads and stores simulation values [app][settings]
the sentences tab writes only settings that differ from the registry [app][settings]
the outputs tab adds, edits, validates and removes outputs [app][settings]
an edited profile round-trips through JSON unchanged [app][settings]
the main window applies a dialog result as the current profile [app][settings]
the simulation tab selects the mode and validates its files [app][settings]
the simulation tab edits the destination [app][settings]
the vessel tab edits the engines and the AIS static data [app][settings]
the sentences tab edits custom sentences and validates them [app][settings]
the outputs tab selects the encoding and its options [app][settings]
an unchanged dialog keeps the random seed and precise coordinates [app][settings]
the sentences tab refuses one-letter talkers and duplicate custom ids [app][settings]
custom sentence placeholders follow the rows and reset keeps the decimals [app][settings]
the outputs tab keeps loaded values and refuses a cleared baud rate [app][settings]
file dialogs start next to a path relative to the profile's file [app][settings]