* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
+
#include <babeltrace/context.h>
#include <babeltrace/iterator.h>
#include <babeltrace/ctf/iterator.h>
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);
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);
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);
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);
babeltrace_debug = 0; /* libbabeltrace.la */
opt_clock_offset = 0; /* libbabeltrace-ctf.la */
- plan_tests(NR_TESTS);
-
if (argc < 4) {
plan_skip_all("Invalid arguments: need a trace path and the start and last timestamp");
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);