Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: yannick.brosseau@gmail.com (Yannick Brosseau)
Subject: [ltt-dev] [UST PATCH] Fix libustctl_function_tests
Date: Wed, 23 Feb 2011 12:46:22 -0500	[thread overview]
Message-ID: <1298483182-18994-1-git-send-email-yannick.brosseau@gmail.com> (raw)

After discussions, we concluded that the enable a non existing marker is a valid case, so we
move it to the working case section.
While being there, check that the re-enable a marker set the right errno

Signed-off-by: Yannick Brosseau <yannick.brosseau at gmail.com>
---
 .../libustctl_function_tests.c                     |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/libustctl_function_tests/libustctl_function_tests.c b/tests/libustctl_function_tests/libustctl_function_tests.c
index 947028f..7c12695 100644
--- a/tests/libustctl_function_tests/libustctl_function_tests.c
+++ b/tests/libustctl_function_tests/libustctl_function_tests.c
@@ -21,6 +21,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <errno.h>
 
 #include <ust/marker.h>
 #include <ust/ustctl.h>
@@ -136,15 +137,16 @@ static void ustctl_function_tests(pid_t pid)
 
 	tap_ok(!ustctl_destroy_trace(trace, pid), "ustctl_destroy_trace - without ever starting");
 
+	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");
@@ -161,7 +163,7 @@ int main(int argc, char **argv)
 	int i, status;
 	pid_t parent_pid, child_pid;
 
-	tap_plan(27);
+	tap_plan(28);
 
 	printf("Function tests for ustctl\n");
 
-- 
1.7.2.3





             reply	other threads:[~2011-02-23 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 17:46 Yannick Brosseau [this message]
2011-02-23 18:51 ` Nils Carlson
2011-02-23 18:43   ` Mathieu Desnoyers
2011-02-23 18:56   ` Nils Carlson
     [not found]   ` <BLU0-SMTP641C88D30CC26BE35858F96DB0@phx.gbl>
2011-02-23 20:54     ` Nils Carlson
2011-02-23 20:56       ` Mathieu Desnoyers
     [not found]       ` <BLU0-SMTP5860CC88B2AC6EDE7D2AEE96DB0@phx.gbl>
2011-02-23 21:20         ` Nils Carlson
2011-02-24  8:56 ` Nils Carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298483182-18994-1-git-send-email-yannick.brosseau@gmail.com \
    --to=yannick.brosseau@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox