Lines Matching refs:accuracy
115 static void test_format_timespan_one(usec_t x, usec_t accuracy) {
120 log_info(USEC_FMT" (at accuracy "USEC_FMT")", x, accuracy);
122 r = format_timespan(l, sizeof(l), x, accuracy);
131 if (accuracy <= 0)
132 accuracy = 1;
134 assert_se(x / accuracy == y / accuracy);
137 static void test_format_timespan(usec_t accuracy) {
138 test_format_timespan_one(0, accuracy);
139 test_format_timespan_one(1, accuracy);
140 test_format_timespan_one(1*USEC_PER_SEC, accuracy);
141 test_format_timespan_one(999*USEC_PER_MSEC, accuracy);
142 test_format_timespan_one(1234567, accuracy);
143 test_format_timespan_one(12, accuracy);
144 test_format_timespan_one(123, accuracy);
145 test_format_timespan_one(1234, accuracy);
146 test_format_timespan_one(12345, accuracy);
147 test_format_timespan_one(123456, accuracy);
148 test_format_timespan_one(1234567, accuracy);
149 test_format_timespan_one(12345678, accuracy);
150 test_format_timespan_one(1200000, accuracy);
151 test_format_timespan_one(1230000, accuracy);
152 test_format_timespan_one(1230000, accuracy);
153 test_format_timespan_one(1234000, accuracy);
154 test_format_timespan_one(1234500, accuracy);
155 test_format_timespan_one(1234560, accuracy);
156 test_format_timespan_one(1234567, accuracy);
157 test_format_timespan_one(986087, accuracy);
158 test_format_timespan_one(500 * USEC_PER_MSEC, accuracy);
159 test_format_timespan_one(9*USEC_PER_YEAR/5 - 23, accuracy);
160 test_format_timespan_one(USEC_INFINITY, accuracy);