wxMaxima
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
test_ConfigRoundtrip.cpp File Reference

Round-trip regression test for the mechanical scalar configuration settings. More...

#include <wx/app.h>
#include <wx/fileconf.h>
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/log.h>
#include "Configuration.h"
#include <cstdlib>
#include <type_traits>
#include <variant>
#include <vector>
#include <utility>
#include <catch2/catch.hpp>
Include dependency graph for test_ConfigRoundtrip.cpp:

Data Structures

class  TestApp
 

Functions

 SCENARIO ("Every scalar setting in the table round-trips through write and read")
 
 SCENARIO ("Settings written only by WriteSettings() survive an OK-path round-trip")
 
 SCENARIO ("How oversized matrices are shown survives a round-trip")
 
 SCENARIO ("What is drawn behind transparent images survives a round-trip")
 
 SCENARIO ("Old configs keep Maxima's help on the console if they had it there")
 
 SCENARIO ("Maxima is told where to show its help")
 
 SCENARIO ("Transparent images get a backdrop exactly where the setting says (GH #2227)")
 
 SCENARIO ("A stored \"no\" from a build that couldn't offer the help sidebar doesn't hide it")
 
 SCENARIO ("Where help is shown survives a round-trip where the sidebar is offered")
 
 wxDECLARE_APP (TestApp)
 
int main (int argc, char **argv)
 

Detailed Description

Round-trip regression test for the mechanical scalar configuration settings.

ReadConfig() and the settings-writing side used to carry independent, hand-synced config->Read()/config->Write() call pairs; if the two ever drifted (a typo, or a key renamed on only one side) the affected setting silently stopped round-tripping - the same recurring bug class the styles had before Configuration::StyleConfigKeys().

Both sides now iterate Configuration::ScalarConfigSettings(). This test guards that table: it perturbs every listed member away from its default, writes the settings to a temporary config file, reads them back into a fresh Configuration, and checks every member arrives unchanged. A future key or type mismatch leaves the fresh instance at the default value for that key and fails the test naming it.