Skip to content

Commit

Permalink
remove C types in unit tests for parser/type/date_type
Browse files Browse the repository at this point in the history
  • Loading branch information
vsian committed Sep 4, 2024
1 parent be4af9d commit 3023452
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/unit_test/parser/type/datetime/date_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#include "gtest/gtest.h"
#include <chrono>
import base_test;

import infinity_exception;
Expand Down Expand Up @@ -95,13 +96,9 @@ TEST_F(DateTypeTest, TestEqStdChronoBackward) {
DateT date;
date.FromString("2020-01-31");

tm tmdate = {};
tmdate.tm_year = 2020 - 1900;
tmdate.tm_mon = 1 - 1;
tmdate.tm_mday = 31;
time_t time_c = mktime(&tmdate);
system_clock::time_point tp = system_clock::from_time_t(time_c);
sys_days sysdays = ceil<days>(tp);

year_month_day ymd = 2020y/January/31d;
sys_days sysdays = sys_days{ymd};

for(i32 i = 0; i < 30000; i++) {
year_month_day ymd = year_month_day(sysdays);
Expand Down
1 change: 0 additions & 1 deletion src/unit_test/parser/type/datetime/date_type_std.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "type/datetime/interval_type.h"
#include "gtest/gtest.h"

import base_test;
Expand Down

0 comments on commit 3023452

Please sign in to comment.