feat(util): add CGameTime::GameTimeSetTime
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run

This commit is contained in:
fallenoak committed 2026-01-28 21:31:24 -06:00
1 parent 1d91a49462
commit 886ababae9
3 files changed
+64 -9

No files matched your search

+18 -7
View File
@@ -16,13 +16,24 @@ TEST_CASE("CGameTime::CGameTime", "[util]") {
}
}
TEST_CASE("CGameTime::TickMinute", "[util]") {
SECTION("ticks minute correctly") {
CGameTime time;
time.SetHourAndMinutes(0, 0);
time.TickMinute();
TEST_CASE("CGameTime::GameTimeSetTime", "[util]") {
SECTION("sets game time correctly") {
WowTime time;
time.m_minute = 18;
time.m_hour = 11;
time.m_weekday = 3;
time.m_monthday = 27;
time.m_month = 0;
time.m_year = 26;
CHECK(time.m_hour == 0);
CHECK(time.m_minute == 1);
CGameTime gameTime;
gameTime.GameTimeSetTime(time, true);
CHECK(gameTime.m_minute == 18);
CHECK(gameTime.m_hour == 11);
CHECK(gameTime.m_weekday == 3);
CHECK(gameTime.m_monthday == 27);
CHECK(gameTime.m_month == 0);
CHECK(gameTime.m_year == 26);
}
}