@@ -608,7 +608,8 @@ TEST_F(ScalarTemporalTest, TestTemporalComponentExtractionAllTemporalTypes) {
608608}
609609
610610TEST_F (ScalarTemporalTest, TestTemporalComponentExtractionWithDifferentUnits) {
611- for (auto u : TimeUnit::values ()) {
611+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
612+ for (auto u : units) {
612613 auto unit = timestamp (u);
613614 CheckScalarUnary (" year" , unit, times_seconds_precision, int64 (), year);
614615 CheckScalarUnary (" is_leap_year" , unit, times_seconds_precision, boolean (),
@@ -814,7 +815,8 @@ TEST_F(ScalarTemporalTest, TestZoned1) {
814815}
815816
816817TEST_F (ScalarTemporalTest, TestZoned2) {
817- for (auto u : TimeUnit::values ()) {
818+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
819+ for (auto u : units) {
818820 auto unit = timestamp (u, " Australia/Broken_Hill" );
819821 auto month = " [1, 3, 1, 5, 1, 12, 12, 12, 1, 1, 1, 1, 12, 12, 12, 1, null]" ;
820822 auto day = " [1, 1, 1, 18, 1, 31, 30, 31, 1, 3, 4, 1, 31, 28, 29, 1, null]" ;
@@ -906,8 +908,9 @@ TEST_F(ScalarTemporalTest, TestNonexistentTimezone) {
906908 auto nonexistent_timezones = {
907909 " Mars/Mariner_Valley" , " +25:00" , " -25:00" , " 15:00" , " 5:00" , " 500" ,
908910 " +05:00:00" , " +050000" };
911+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
909912 for (auto timezone : nonexistent_timezones) {
910- for (auto u : TimeUnit::values () ) {
913+ for (auto u : units ) {
911914 auto ts_type = timestamp (u, timezone);
912915 auto timestamp_array = std::make_shared<NumericArray<TimestampType>>(
913916 ts_type, 2 , data_buffer, null_buffer, 0 );
@@ -1026,7 +1029,8 @@ TEST_F(ScalarTemporalTest, DayOfWeek) {
10261029}
10271030
10281031TEST_F (ScalarTemporalTest, TestTemporalDifference) {
1029- for (auto u : TimeUnit::values ()) {
1032+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
1033+ for (auto u : units) {
10301034 auto unit = timestamp (u);
10311035 auto arr1 = ArrayFromJSON (unit, times_seconds_precision);
10321036 auto arr2 = ArrayFromJSON (unit, times_seconds_precision2);
@@ -1879,8 +1883,9 @@ TEST_F(ScalarTemporalTest, TestLocalTimestamp) {
18791883 "2009-12-30 18:50:20", "2009-12-31 19:55:25", "2010-01-02 21:00:30",
18801884 "2010-01-03 22:05:35", "2005-12-31 23:10:40", "2005-12-31 00:15:45",
18811885 "2008-12-27 14:30:00", "2008-12-28 14:30:00", "2011-12-31 15:32:03", null])" ;
1886+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
18821887
1883- for (auto u : TimeUnit::values () ) {
1888+ for (auto u : units ) {
18841889 CheckScalarUnary (" local_timestamp" , timestamp (u), times_seconds_precision,
18851890 timestamp (u), times_seconds_precision);
18861891 CheckScalarUnary (" local_timestamp" , timestamp (u, " UTC" ), times_seconds_precision,
@@ -1912,8 +1917,9 @@ TEST_F(ScalarTemporalTest, TestAssumeTimezone) {
19121917 auto options_tbilisi = AssumeTimezoneOptions (timezone_tbilisi);
19131918 auto options_tbilisi_offset = AssumeTimezoneOptions (timezone_tbilisi_offset);
19141919 auto options_invalid = AssumeTimezoneOptions (" Europe/Brusselsss" );
1920+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
19151921
1916- for (auto u : TimeUnit::values () ) {
1922+ for (auto u : units ) {
19171923 auto unit = timestamp (u);
19181924 auto unit_utc = timestamp (u, timezone_utc);
19191925 auto unit_kolkata = timestamp (u, timezone_kolkata);
@@ -1956,8 +1962,9 @@ TEST_F(ScalarTemporalTest, TestAssumeTimezoneAmbiguous) {
19561962 AssumeTimezoneOptions (timezone, AssumeTimezoneOptions::AMBIGUOUS_LATEST);
19571963 auto options_raise =
19581964 AssumeTimezoneOptions (timezone, AssumeTimezoneOptions::AMBIGUOUS_RAISE);
1965+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
19591966
1960- for (auto u : TimeUnit::values () ) {
1967+ for (auto u : units ) {
19611968 auto unit = timestamp (u);
19621969 auto unit_local = timestamp (u, timezone);
19631970 ASSERT_RAISES (Invalid, AssumeTimezone (ArrayFromJSON (unit, times), options_raise));
@@ -1989,8 +1996,9 @@ TEST_F(ScalarTemporalTest, TestAssumeTimezoneNonexistent) {
19891996 auto options_earliest =
19901997 AssumeTimezoneOptions (timezone, AssumeTimezoneOptions::AMBIGUOUS_RAISE,
19911998 AssumeTimezoneOptions::NONEXISTENT_EARLIEST);
1999+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
19922000
1993- for (auto u : TimeUnit::values () ) {
2001+ for (auto u : units ) {
19942002 auto unit = timestamp (u);
19952003 auto unit_local = timestamp (u, timezone);
19962004 ASSERT_RAISES (Invalid, AssumeTimezone (ArrayFromJSON (unit, times), options_raise));
@@ -2245,7 +2253,8 @@ TEST_F(ScalarTemporalTest, StrftimeInvalidLocale) {
22452253}
22462254
22472255TEST_F (ScalarTemporalTest, TestTemporalDifferenceZoned) {
2248- for (auto u : TimeUnit::values ()) {
2256+ auto units = {TimeUnit::SECOND, TimeUnit::MILLI, TimeUnit::MICRO, TimeUnit::NANO};
2257+ for (auto u : units) {
22492258 auto unit = timestamp (u, " Pacific/Marquesas" );
22502259 auto arr1 = ArrayFromJSON (unit, times_seconds_precision);
22512260 auto arr2 = ArrayFromJSON (unit, times_seconds_precision2);
0 commit comments