5 #include "eruntime/version.h"
7 static int t_eruntime_get_version (void);
8 static int t_eruntime_compare_versions (void);
10 typedef int (*test_case_func
) (void);
12 typedef struct _test_case_struct
20 /* {{{ static test_case_t version_tests[] = { ... } */
21 static test_case_t version_tests
[] =
24 "eruntime_get_version",
25 "function eruntime_get_version()",
26 t_eruntime_get_version
29 "eruntime_compare_versions",
30 "function t_eruntime_compare_versions()",
31 t_eruntime_compare_versions
,
42 test_case_t
*tc
= NULL
;
48 for (tc
= version_tests
; tc
->name
; ++tc
)
50 printf("Testing %s... ", tc
->desc
);
53 if (ret
== EXIT_SUCCESS
)
54 fputs("success\n", stdout
);
56 fprintf(stderr
, "\nTest '%s' failed\n", tc
->name
);
63 /* {{{ static int t_eruntime_get_version() */
65 t_eruntime_get_version (void)
69 if (eruntime_get_version(&ev
) < 0)
71 fprintf(stderr
, "eruntime_get_version() failed\n");
79 /* {{{ static int t_eruntime_compare_versions() */
81 t_eruntime_compare_versions (void)
83 version_spec_t ev
, ev_copy
;
86 if (eruntime_get_version(&ev
) < 0)
88 fprintf(stderr
, "eruntime_get_version() failed\n");
92 memcpy(&ev_copy
, &ev
, sizeof(ev
));
93 sort_order
= eruntime_compare_versions(&ev
, &ev_copy
);
96 fprintf(stderr
, "\n\n"
108 * vim: ts=8 sw=8 noet fdm=marker tw=80 :