#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
uint64_t expected = 1483228862000;
if (ret != expected) {
printf("Returned value %" PRIu64 " does not mach the expected value %" PRIu64
"\n",
ret,
expected);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
uint64_t expected = 1483228862001;
if (ret != expected) {
printf("Returned value %" PRIu64 " does not mach the expected value %" PRIu64
"\n",
ret,
expected);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
uint64_t expected = 1492582746999;
if (ret != expected) {
printf("Returned value %" PRIu64 " does not mach the expected value %" PRIu64
"\n",
ret,
expected);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
int main(
int argc,
char **argv) {
}
}
return EXIT_FAILURE;
}
int main(int argc, char **argv)
Definition: gru_list_test.c:198
int test_lost_precision_1()
Uses usec value that would cause the conversion to lost precision (ie: usec <= 999)
Definition: gru_time_conversion_test.c:25
int test_lost_precision_2()
Uses usec value that would cause the conversion to lost some precision (ie: usec > 1000)
Definition: gru_time_conversion_test.c:47
int test_lost_precision_3()
Definition: gru_time_conversion_test.c:69
gru_timestamp_t gru_time_read_str(const char *str)
Read a string in the format seconds.microseconds and return a struct timeval.
Definition: gru_time_utils.c:51
int64_t gru_time_to_milli(const gru_timestamp_t *ts)
Converts a timestamp to milliseconds.
Definition: gru_time_utils.c:147
struct timeval gru_timestamp_t
An alias to struct timeval.
Definition: gru_time_utils.h:55