Lines Matching refs:tm

65   tm* broken_down = gmtime(&t);  in TEST()
76 struct tm tm = {}; in TEST() local
78 struct tm* broken_down = gmtime_r(&t, &tm); in TEST()
79 ASSERT_EQ(broken_down, &tm); in TEST()
117 struct tm t; in TEST()
118 memset(&t, 0, sizeof(tm)); in TEST()
127 memset(&t, 0, sizeof(tm)); in TEST()
138 struct tm t; in TEST()
139 memset(&t, 0, sizeof(tm)); in TEST()
167 struct tm t; in TEST()
168 memset(&t, 0, sizeof(tm)); in TEST()
191 struct tm t; in TEST()
192 memset(&t, 0, sizeof(tm)); in TEST()
212 struct tm t; in TEST()
213 memset(&t, 0, sizeof(tm)); in TEST()
254 struct tm t; in TEST()
255 memset(&t, 0, sizeof(tm)); in TEST()
272 struct tm t; in TEST()
289 struct tm t; in TEST()
306 struct tm tm = {}; in TEST() local
307 ASSERT_EQ('\0', *strptime("2019-03-26", "%F", &tm)); in TEST()
308 EXPECT_EQ(119, tm.tm_year); in TEST()
309 EXPECT_EQ(2, tm.tm_mon); in TEST()
310 EXPECT_EQ(26, tm.tm_mday); in TEST()
318 struct tm tm = {.tm_hour = 12}; in TEST() local
319 ASSERT_EQ('\0', *strptime("AM", "%p", &tm)); in TEST()
320 EXPECT_EQ(0, tm.tm_hour); in TEST()
322 tm = {.tm_hour = 12}; in TEST()
323 ASSERT_EQ('\0', *strptime("am", "%p", &tm)); in TEST()
324 EXPECT_EQ(0, tm.tm_hour); in TEST()
326 tm = {.tm_hour = 12}; in TEST()
327 ASSERT_EQ('\0', *strptime("AM", "%P", &tm)); in TEST()
328 EXPECT_EQ(0, tm.tm_hour); in TEST()
330 tm = {.tm_hour = 12}; in TEST()
331 ASSERT_EQ('\0', *strptime("am", "%P", &tm)); in TEST()
332 EXPECT_EQ(0, tm.tm_hour); in TEST()
338 struct tm tm = {}; in TEST() local
339 ASSERT_EQ('\0', *strptime("2", "%u", &tm)); in TEST()
340 EXPECT_EQ(2, tm.tm_wday); in TEST()
346 struct tm tm = {}; in TEST() local
347 ASSERT_EQ('\0', *strptime("26-Mar-1980", "%v", &tm)); in TEST()
348 EXPECT_EQ(80, tm.tm_year); in TEST()
349 EXPECT_EQ(2, tm.tm_mon); in TEST()
350 EXPECT_EQ(26, tm.tm_mday); in TEST()
360 struct tm tm = {}; in TEST() local
361 ASSERT_EQ('\0', *strptime("1 2 3", "%V %G %g", &tm)); in TEST()
362 struct tm zero = {}; in TEST()
363 EXPECT_TRUE(memcmp(&tm, &zero, sizeof(tm)) == 0); in TEST()
853 struct tm tm; in TEST() local
857 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
858 EXPECT_EQ(15, tm.tm_hour); in TEST()
862 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
863 EXPECT_EQ(23, tm.tm_hour); in TEST()
867 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
868 EXPECT_EQ(13, tm.tm_hour); in TEST()
872 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
873 EXPECT_EQ(12, tm.tm_hour); in TEST()
877 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
878 EXPECT_EQ(12, tm.tm_hour); in TEST()
882 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
883 EXPECT_EQ(9, tm.tm_hour); in TEST()
904 struct tm* tm_p = localtime(&t); in TEST()
914 struct tm tm = {}; in TEST() local
915 localtime_r(&t, &tm); in TEST()
916 EXPECT_EQ(15, tm.tm_hour); in TEST()
923 const struct tm tm = {}; in TEST() local
924 ASSERT_STREQ("Sun Jan 0 00:00:00 1900\n", asctime(&tm)); in TEST()
928 const struct tm tm = {}; in TEST() local
930 ASSERT_EQ(buf, asctime_r(&tm, buf)); in TEST()
951 const struct tm tm0 = { .tm_year = 1982-1900, .tm_mon = 0, .tm_mday = 1 }; in TEST()
961 struct tm tm; in TEST() local
965 memset(&tm, 0xff, sizeof(tm)); in TEST()
966 char* p = strptime("378720000x", "%s", &tm); in TEST()
968 EXPECT_EQ(0, tm.tm_sec); in TEST()
969 EXPECT_EQ(0, tm.tm_min); in TEST()
970 EXPECT_EQ(0, tm.tm_hour); in TEST()
971 EXPECT_EQ(1, tm.tm_mday); in TEST()
972 EXPECT_EQ(0, tm.tm_mon); in TEST()
973 EXPECT_EQ(82, tm.tm_year); in TEST()
974 EXPECT_EQ(5, tm.tm_wday); in TEST()
975 EXPECT_EQ(0, tm.tm_yday); in TEST()
976 EXPECT_EQ(0, tm.tm_isdst); in TEST()
980 memset(&tm, 0xff, sizeof(tm)); in TEST()
981 p = strptime("378691200x", "%s", &tm); in TEST()
983 EXPECT_EQ(0, tm.tm_sec); in TEST()
984 EXPECT_EQ(0, tm.tm_min); in TEST()
985 EXPECT_EQ(0, tm.tm_hour); in TEST()
986 EXPECT_EQ(1, tm.tm_mday); in TEST()
987 EXPECT_EQ(0, tm.tm_mon); in TEST()
988 EXPECT_EQ(82, tm.tm_year); in TEST()
989 EXPECT_EQ(5, tm.tm_wday); in TEST()
990 EXPECT_EQ(0, tm.tm_yday); in TEST()
991 EXPECT_EQ(0, tm.tm_isdst); in TEST()
995 struct tm tm; in TEST() local
996 ASSERT_EQ(nullptr, strptime("x", "%s", &tm)); in TEST()