Skip to content

Commit

Permalink
Workaround for compiling tests
Browse files Browse the repository at this point in the history
Casts mission hardware to char * to allow using strcpy on it,
preventing a compiler error following the introduction of JSON
serialization. Fixes raceintospace#656.
  • Loading branch information
hweimer committed Jun 7, 2022
1 parent ee532bd commit d8734a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/game/downgrade_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct DowngradeFixture {
mission.MissionCode = Mission_HistoricalLanding;
mission.Patch = 29;
mission.part = 1;
strcpy(mission.Hard, "ABCDE");
strcpy((char *) mission.Hard, "ABCDE");
mission.Joint = 1;
mission.Rushing = 0;
mission.Month = 7;
Expand Down
2 changes: 1 addition & 1 deletion test/game/mission_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(missiontype_equals_test)
BOOST_CHECK( Equals(m1, m3) == false );

m3 = m2;
strcpy(m3.Hard, "IJKLM");
strcpy((char *) m3.Hard, "IJKLM");

BOOST_CHECK( Equals(m1, m3) == false );

Expand Down

0 comments on commit d8734a4

Please sign in to comment.