@@ -47,9 +47,14 @@ class RTC_time_calc_test(BaseHostTest):
47
47
48
48
edge_date = datetime .datetime (2100 , 2 , 28 , 0 , 0 , 0 )
49
49
50
- years = [1970 , 1971 , 1972 , 1973 , 1974 , 1975 , 1976 , 1977 , 1978 , 1979 , 1980 ,
51
- 2000 , 2001 , 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
52
- 2099 , 2100 , 2101 , 2102 , 2103 , 2104 , 2105 , 2106 ]
50
+ # Test the following years:
51
+ # - first - 1970
52
+ # - example not leap year (not divisible by 4)
53
+ # - example leap year (divisible by 4 and by 100 and by 400)
54
+ # - example leap year (divisible by 4 and not by 100)
55
+ # - example not leap year (divisible by 4 and by 100)
56
+ # - last fully supported - 2105
57
+ years = [1970 , 1971 , 2000 , 2096 , 2100 , 2105 ]
53
58
year_id = 0
54
59
55
60
@@ -123,6 +128,9 @@ def _verify_timestamp(self, key, value, timestamp):
123
128
self .date += datetime .timedelta (days = 1 )
124
129
if (self .date .month == 1 ):
125
130
self .year_id += 1
131
+ if (len (self .years ) == self .year_id ):
132
+ # All years were processed, no need to calc next date
133
+ return
126
134
self .date = self .date .replace (year = self .years [self .year_id ])
127
135
self .date = self .date .replace (day = 1 , minute = 0 , second = 0 )
128
136
self .first = not self .first
0 commit comments