4 #include "test-stuff.h"
6 #include "test-file-stuff.h"
10 #include "sixtp-utils.h"
11 #include "sixtp-dom-generators.h"
13 #define GNC_V2_STRING "gnc-v2"
14 const gchar *gnc_v2_xml_version_string = GNC_V2_STRING;
17 main(
int argc,
char **argv)
21 for (i = 0; i < 20; i++)
28 spec1 = get_random_timespec();
30 sec_str = timespec_sec_to_string(spec1);
31 nsec_str = timespec_nsec_to_string(spec1);
33 if (!string_to_timespec_secs(sec_str, &spec2))
35 failure_args(
"string_to_timespec_secs", __FILE__, __LINE__,
36 "string is %s", sec_str);
39 else if (!string_to_timespec_nsecs(nsec_str, &spec2))
41 failure_args(
"string_to_timespec_nsecs", __FILE__, __LINE__,
42 "string is %s", nsec_str);
45 else if (spec1->tv_sec != spec2.tv_sec)
47 failure_args(
"timespec_secs", __FILE__, __LINE__,
48 "not equal ints are %" G_GINT64_FORMAT
49 " and %" G_GINT64_FORMAT
"\n",
50 spec1->tv_sec, spec2.tv_sec);
53 else if (spec1->tv_nsec != spec2.tv_nsec)
55 failure_args(
"timespec_nsecs", __FILE__, __LINE__,
56 "not equal ints are %ld and %ld\n",
57 spec1->tv_nsec, spec2.tv_nsec);
Use a 64-bit unsigned int timespec.