X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Flibustctl_function_tests%2Flibustctl_function_tests.c;h=146199713bd24169f302ad770aa350b4782f2f08;hb=bc549f166d7ece1bfd6d1a937019a7568b38b332;hp=784ff5d01b4646b3f049c1952f5d2d492fc2c42e;hpb=cacf036243594e11fc8a7e0f47f07af97a79042f;p=ust.git diff --git a/tests/libustctl_function_tests/libustctl_function_tests.c b/tests/libustctl_function_tests/libustctl_function_tests.c index 784ff5d..1461997 100644 --- a/tests/libustctl_function_tests/libustctl_function_tests.c +++ b/tests/libustctl_function_tests/libustctl_function_tests.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include @@ -135,15 +137,20 @@ static void ustctl_function_tests(pid_t pid) tap_ok(!ustctl_destroy_trace(trace, pid), "ustctl_destroy_trace - without ever starting"); + /* + * Activate a non-existent marker, this should be possible as the marker + * can be loaded at a later time. + */ + tap_ok(ustctl_set_marker_state(trace, "ustl", "blar", 1, pid) == 0, + "Enable non-existent marker ustl blar"); printf("##### Tests that definetly should work are completed #####\n"); printf("############## Start expected failure cases ##############\n"); tap_ok(ustctl_set_marker_state(trace, "ust","bar", 1, pid), "Enable already enabled marker ust/bar"); - - tap_ok(ustctl_set_marker_state(trace, "ustl", "blar", 1, pid), - "Enable non-existent marker ustl blar"); + tap_ok(EEXIST == errno, + "Right error code for enabling an already enabled marker"); tap_ok(ustctl_start_trace(trace, pid), "Start a non-existent trace"); @@ -155,14 +162,12 @@ static void ustctl_function_tests(pid_t pid) } - -int main() +int main(int argc, char **argv) { - int i, status, pipefd[2]; + int i, status; pid_t parent_pid, child_pid; - FILE *pipe_file; - tap_plan(27); + tap_plan(28); printf("Function tests for ustctl\n");