Fix DateTime::GetDate calculations

#2089 #2086
This commit is contained in:
Wojtek Figat
2024-01-05 11:13:41 +01:00
parent 6fb6769574
commit 976d0992df
2 changed files with 27 additions and 3 deletions

View File

@@ -0,0 +1,26 @@
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#include "Engine/Core/Types/DateTime.h"
#include <ThirdParty/catch2/catch.hpp>
TEST_CASE("DateTime")
{
SECTION("Test Convertion")
{
constexpr int year = 2023;
constexpr int month = 12;
constexpr int day = 16;
constexpr int hour = 23;
constexpr int minute = 50;
constexpr int second = 13;
constexpr int millisecond = 5;
const DateTime dt1(year, month, day, hour, minute, second, millisecond);
CHECK(dt1.GetYear() == year);
CHECK(dt1.GetMonth() == month);
CHECK(dt1.GetDay() == day);
CHECK(dt1.GetHour() == hour);
CHECK(dt1.GetMinute() == minute);
CHECK(dt1.GetSecond() == second);
CHECK(dt1.GetMillisecond() == millisecond);
}
}