So I implemented my idea to put remaining_shipnames_.clear() before reading the savegame and it works, as can be confirmed by printfs:
1: Populating shipnames vector, now 34
1: Loading shipnames from savegame, now 30
2: Populating shipnames vector, now 34
2: Loading shipnames from savegame, now 34
3: Populating shipnames vector, now 58
......
So player 1 has 4 ships, correct?
Somebody more skilled in regression tests should advice how to make sure fullfledged save and load of game is be done in regression tests. If this can be done, also test like you suggested should be trivial...
So I implemented my idea to put remaining_ shipnames_ .clear( ) before reading the savegame and it works, as can be confirmed by printfs:
1: Populating shipnames vector, now 34
1: Loading shipnames from savegame, now 30
2: Populating shipnames vector, now 34
2: Loading shipnames from savegame, now 34
3: Populating shipnames vector, now 58
......
So player 1 has 4 ships, correct?
Somebody more skilled in regression tests should advice how to make sure fullfledged save and load of game is be done in regression tests. If this can be done, also test like you suggested should be trivial...