X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Flib%2Ftest_seek.c;h=e9b23e5c0c00e980a30c623a0eeb76a055115dc1;hb=8099326b3438eb003bf3f9849ad1b3cd1f0d618c;hp=b33f80dc2e08455987ecc01b244916371712e417;hpb=6b31ae9ce6bdca8682a6c936c6c20caae378e021;p=babeltrace.git diff --git a/tests/lib/test_seek.c b/tests/lib/test_seek.c index b33f80dc..e9b23e5c 100644 --- a/tests/lib/test_seek.c +++ b/tests/lib/test_seek.c @@ -23,11 +23,12 @@ #include #include #include +#include /* For symbol side-effects */ #include #include #include -#include +#include #include #include "common.h" @@ -43,17 +44,22 @@ void run_seek_begin(char *path, uint64_t expected_begin) int ret; uint64_t timestamp_begin; uint64_t timestamp_seek_begin; + unsigned int nr_seek_begin_test; + + nr_seek_begin_test = 5; /* Open the trace */ ctx = create_context_with_path(path); if (!ctx) { - plan_skip_all("Cannot create valid context"); + skip(nr_seek_begin_test, "Cannot create valid context"); + return; } /* Create iterator with null begin and end */ iter = bt_ctf_iter_create(ctx, NULL, NULL); if (!iter) { - plan_skip_all("Cannot create valid iterator"); + skip(nr_seek_begin_test, "Cannot create valid iterator"); + return; } event = bt_ctf_iter_read_event(iter); @@ -91,17 +97,22 @@ void run_seek_last(char *path, uint64_t expected_last) struct bt_iter_pos newpos; int ret; uint64_t timestamp_last; + unsigned int nr_seek_last_tests; + + nr_seek_last_tests = 6; /* Open the trace */ ctx = create_context_with_path(path); if (!ctx) { - plan_skip_all("Cannot create valid context"); + skip(nr_seek_last_tests, "Cannot create valid context"); + return; } /* Create iterator with null last and end */ iter = bt_ctf_iter_create(ctx, NULL, NULL); if (!iter) { - plan_skip_all("Cannot create valid iterator"); + skip(nr_seek_last_tests, "Cannot create valid iterator"); + return; } event = bt_ctf_iter_read_event(iter); @@ -142,17 +153,24 @@ void run_seek_time_at_last(char *path, uint64_t expected_last) struct bt_iter_pos newpos; int ret; uint64_t timestamp_last; + unsigned int nr_seek_time_at_last_tests; + + nr_seek_time_at_last_tests = 6; /* Open the trace */ ctx = create_context_with_path(path); if (!ctx) { - plan_skip_all("Cannot create valid context"); + skip(nr_seek_time_at_last_tests, + "Cannot create valid context"); + return; } /* Create iterator with null last and end */ iter = bt_ctf_iter_create(ctx, NULL, NULL); if (!iter) { - plan_skip_all("Cannot create valid iterator"); + skip(nr_seek_time_at_last_tests, + "Cannot create valid iterator"); + return; } event = bt_ctf_iter_read_event(iter); @@ -197,16 +215,22 @@ void run_seek_cycles(char *path, int ret; uint64_t timestamp; + unsigned int nr_seek_cycles_tests; + + nr_seek_cycles_tests = 12; + /* Open the trace */ ctx = create_context_with_path(path); if (!ctx) { - plan_skip_all("Cannot create valid context"); + skip(nr_seek_cycles_tests, "Cannot create valid context"); + return; } /* Create iterator with null last and end */ iter = bt_ctf_iter_create(ctx, NULL, NULL); if (!iter) { - plan_skip_all("Cannot create valid iterator"); + skip(nr_seek_cycles_tests, "Cannot create valid iterator"); + return; } event = bt_ctf_iter_read_event(iter); @@ -273,7 +297,12 @@ int main(int argc, char **argv) uint64_t expected_begin; uint64_t expected_last; - plan_tests(NR_TESTS); + /* + * Side-effects ensuring libs are not optimized away by static + * linking. + */ + babeltrace_debug = 0; /* libbabeltrace.la */ + opt_clock_offset = 0; /* libbabeltrace-ctf.la */ if (argc < 4) { plan_skip_all("Invalid arguments: need a trace path and the start and last timestamp"); @@ -293,6 +322,8 @@ int main(int argc, char **argv) plan_skip_all("Invalid value for last timestamp"); } + plan_tests(NR_TESTS); + run_seek_begin(path, expected_begin); run_seek_time_at_last(path, expected_last); run_seek_last(path, expected_last);