Lines Matching refs:tm

63   tm* broken_down = gmtime(&t);  in TEST()
74 struct tm tm = {}; in TEST() local
76 struct tm* broken_down = gmtime_r(&t, &tm); in TEST()
77 ASSERT_EQ(broken_down, &tm); in TEST()
115 struct tm t; in TEST()
116 memset(&t, 0, sizeof(tm)); in TEST()
125 memset(&t, 0, sizeof(tm)); in TEST()
136 struct tm t; in TEST()
137 memset(&t, 0, sizeof(tm)); in TEST()
165 struct tm t; in TEST()
166 memset(&t, 0, sizeof(tm)); in TEST()
189 struct tm t; in TEST()
190 memset(&t, 0, sizeof(tm)); in TEST()
210 struct tm t; in TEST()
211 memset(&t, 0, sizeof(tm)); in TEST()
252 struct tm t; in TEST()
253 memset(&t, 0, sizeof(tm)); in TEST()
270 struct tm t; in TEST()
287 struct tm t; in TEST()
304 struct tm tm = {}; in TEST() local
305 ASSERT_EQ('\0', *strptime("2019-03-26", "%F", &tm)); in TEST()
306 EXPECT_EQ(119, tm.tm_year); in TEST()
307 EXPECT_EQ(2, tm.tm_mon); in TEST()
308 EXPECT_EQ(26, tm.tm_mday); in TEST()
316 struct tm tm = {.tm_hour = 12}; in TEST() local
317 ASSERT_EQ('\0', *strptime("AM", "%p", &tm)); in TEST()
318 EXPECT_EQ(0, tm.tm_hour); in TEST()
320 tm = {.tm_hour = 12}; in TEST()
321 ASSERT_EQ('\0', *strptime("am", "%p", &tm)); in TEST()
322 EXPECT_EQ(0, tm.tm_hour); in TEST()
324 tm = {.tm_hour = 12}; in TEST()
325 ASSERT_EQ('\0', *strptime("AM", "%P", &tm)); in TEST()
326 EXPECT_EQ(0, tm.tm_hour); in TEST()
328 tm = {.tm_hour = 12}; in TEST()
329 ASSERT_EQ('\0', *strptime("am", "%P", &tm)); in TEST()
330 EXPECT_EQ(0, tm.tm_hour); in TEST()
336 struct tm tm = {}; in TEST() local
337 ASSERT_EQ('\0', *strptime("2", "%u", &tm)); in TEST()
338 EXPECT_EQ(2, tm.tm_wday); in TEST()
344 struct tm tm = {}; in TEST() local
345 ASSERT_EQ('\0', *strptime("26-Mar-1980", "%v", &tm)); in TEST()
346 EXPECT_EQ(80, tm.tm_year); in TEST()
347 EXPECT_EQ(2, tm.tm_mon); in TEST()
348 EXPECT_EQ(26, tm.tm_mday); in TEST()
358 struct tm tm = {}; in TEST() local
359 ASSERT_EQ('\0', *strptime("1 2 3", "%V %G %g", &tm)); in TEST()
360 struct tm zero = {}; in TEST()
361 EXPECT_TRUE(memcmp(&tm, &zero, sizeof(tm)) == 0); in TEST()
369 struct tm tm; in TEST() local
373 tm = {}; in TEST()
374 ASSERT_EQ('\0', *strptime("GMT", "%Z", &tm)); in TEST()
375 EXPECT_STREQ("GMT", tm.tm_zone); in TEST()
376 EXPECT_EQ(0, tm.tm_isdst); in TEST()
377 EXPECT_EQ(0, tm.tm_gmtoff); in TEST()
380 tm = {}; in TEST()
381 ASSERT_EQ('\0', *strptime("UTC", "%Z", &tm)); in TEST()
382 EXPECT_STREQ("UTC", tm.tm_zone); in TEST()
383 EXPECT_EQ(0, tm.tm_isdst); in TEST()
384 EXPECT_EQ(0, tm.tm_gmtoff); in TEST()
387 tm = {}; in TEST()
388 ASSERT_EQ('\0', *strptime("CET", "%Z", &tm)); in TEST()
389 EXPECT_STREQ("CET", tm.tm_zone); in TEST()
390 EXPECT_EQ(0, tm.tm_isdst); in TEST()
391 EXPECT_EQ(3600, tm.tm_gmtoff); in TEST()
394 tm = {}; in TEST()
395 ASSERT_EQ('\0', *strptime("CEST", "%Z", &tm)); in TEST()
396 EXPECT_STREQ("CEST", tm.tm_zone); in TEST()
397 EXPECT_EQ(1, tm.tm_isdst); in TEST()
398 EXPECT_EQ(3600, tm.tm_gmtoff); in TEST()
402 tm = {}; in TEST()
403 ASSERT_TRUE(strptime("PDT", "%Z", &tm) == nullptr); in TEST()
408 struct tm tm; in TEST() local
412 tm = {}; in TEST()
413 ASSERT_EQ('\0', *strptime("UT", "%z", &tm)); in TEST()
414 EXPECT_STREQ("UTC", tm.tm_zone); in TEST()
415 EXPECT_EQ(0, tm.tm_isdst); in TEST()
416 EXPECT_EQ(0, tm.tm_gmtoff); in TEST()
418 tm = {}; in TEST()
419 ASSERT_EQ('\0', *strptime("GMT", "%z", &tm)); in TEST()
420 EXPECT_STREQ("UTC", tm.tm_zone); in TEST()
421 EXPECT_EQ(0, tm.tm_isdst); in TEST()
422 EXPECT_EQ(0, tm.tm_gmtoff); in TEST()
425 tm = {}; in TEST()
426 ASSERT_EQ('\0', *strptime("Z", "%z", &tm)); in TEST()
427 EXPECT_STREQ("UTC", tm.tm_zone); in TEST()
428 EXPECT_EQ(0, tm.tm_isdst); in TEST()
429 EXPECT_EQ(0, tm.tm_gmtoff); in TEST()
432 tm = {}; in TEST()
433 ASSERT_EQ('\0', *strptime("PST", "%z", &tm)); in TEST()
434 EXPECT_STREQ("PST", tm.tm_zone); in TEST()
435 EXPECT_EQ(0, tm.tm_isdst); in TEST()
436 EXPECT_EQ(-28800, tm.tm_gmtoff); in TEST()
437 tm = {}; in TEST()
438 ASSERT_EQ('\0', *strptime("PDT", "%z", &tm)); in TEST()
439 EXPECT_STREQ("PDT", tm.tm_zone); in TEST()
440 EXPECT_EQ(1, tm.tm_isdst); in TEST()
441 EXPECT_EQ(-25200, tm.tm_gmtoff); in TEST()
444 tm = {}; in TEST()
445 ASSERT_EQ('\0', *strptime("+01", "%z", &tm)); in TEST()
446 EXPECT_EQ(3600, tm.tm_gmtoff); in TEST()
447 EXPECT_TRUE(tm.tm_zone == nullptr); in TEST()
448 EXPECT_EQ(0, tm.tm_isdst); in TEST()
450 tm = {}; in TEST()
451 ASSERT_EQ('\0', *strptime("+0130", "%z", &tm)); in TEST()
452 EXPECT_EQ(5400, tm.tm_gmtoff); in TEST()
453 EXPECT_TRUE(tm.tm_zone == nullptr); in TEST()
454 EXPECT_EQ(0, tm.tm_isdst); in TEST()
456 tm = {}; in TEST()
457 ASSERT_EQ('\0', *strptime("+01:30", "%z", &tm)); in TEST()
458 EXPECT_EQ(5400, tm.tm_gmtoff); in TEST()
459 EXPECT_TRUE(tm.tm_zone == nullptr); in TEST()
460 EXPECT_EQ(0, tm.tm_isdst); in TEST()
954 struct tm tm; in TEST() local
958 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
959 EXPECT_EQ(15, tm.tm_hour); in TEST()
963 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
964 EXPECT_EQ(23, tm.tm_hour); in TEST()
968 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
969 EXPECT_EQ(13, tm.tm_hour); in TEST()
973 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
974 EXPECT_EQ(12, tm.tm_hour); in TEST()
978 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
979 EXPECT_EQ(12, tm.tm_hour); in TEST()
983 ASSERT_TRUE(localtime_r(&t, &tm) != nullptr); in TEST()
984 EXPECT_EQ(9, tm.tm_hour); in TEST()
1005 struct tm* tm_p = localtime(&t); in TEST()
1015 struct tm tm = {}; in TEST() local
1016 localtime_r(&t, &tm); in TEST()
1017 EXPECT_EQ(15, tm.tm_hour); in TEST()
1024 const struct tm tm = {}; in TEST() local
1025 ASSERT_STREQ("Sun Jan 0 00:00:00 1900\n", asctime(&tm)); in TEST()
1029 const struct tm tm = {}; in TEST() local
1031 ASSERT_EQ(buf, asctime_r(&tm, buf)); in TEST()
1052 const struct tm tm0 = { .tm_year = 1982-1900, .tm_mon = 0, .tm_mday = 1 }; in TEST()
1062 struct tm tm; in TEST() local
1066 memset(&tm, 0xff, sizeof(tm)); in TEST()
1067 char* p = strptime("378720000x", "%s", &tm); in TEST()
1069 EXPECT_EQ(0, tm.tm_sec); in TEST()
1070 EXPECT_EQ(0, tm.tm_min); in TEST()
1071 EXPECT_EQ(0, tm.tm_hour); in TEST()
1072 EXPECT_EQ(1, tm.tm_mday); in TEST()
1073 EXPECT_EQ(0, tm.tm_mon); in TEST()
1074 EXPECT_EQ(82, tm.tm_year); in TEST()
1075 EXPECT_EQ(5, tm.tm_wday); in TEST()
1076 EXPECT_EQ(0, tm.tm_yday); in TEST()
1077 EXPECT_EQ(0, tm.tm_isdst); in TEST()
1081 memset(&tm, 0xff, sizeof(tm)); in TEST()
1082 p = strptime("378691200x", "%s", &tm); in TEST()
1084 EXPECT_EQ(0, tm.tm_sec); in TEST()
1085 EXPECT_EQ(0, tm.tm_min); in TEST()
1086 EXPECT_EQ(0, tm.tm_hour); in TEST()
1087 EXPECT_EQ(1, tm.tm_mday); in TEST()
1088 EXPECT_EQ(0, tm.tm_mon); in TEST()
1089 EXPECT_EQ(82, tm.tm_year); in TEST()
1090 EXPECT_EQ(5, tm.tm_wday); in TEST()
1091 EXPECT_EQ(0, tm.tm_yday); in TEST()
1092 EXPECT_EQ(0, tm.tm_isdst); in TEST()
1096 struct tm tm; in TEST() local
1097 ASSERT_EQ(nullptr, strptime("x", "%s", &tm)); in TEST()