[Xcb-commit] Branch 'debian' - debian tests

Josh Triplett josh at kemper.freedesktop.org
Thu Nov 30 17:26:11 PST 2006


 debian/changelog     |    1 +
 tests/check_public.c |   11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
diff-tree c679d938e4f73bc552119f08cbef4adc207c2bbc (from 3c0727554e102edd78c3944f7e32b837377e91c0)
Author: Ian Osgood <iano at quirkster.com>
Date:   Sun Nov 26 09:26:32 2006 -0800

    Fix unit tests for FreeBSD
    
    putenv() string must contain '='
    environment failure test is invalid if argument is NULL
    (cherry picked from commit 19dfaf93ac1b5e9d3ce09b1f8e2338e53a5d7324)

diff --git a/debian/changelog b/debian/changelog
index 5e9720b..f2f4b45 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ libxcb (1.0-1) experimental; urgency=low
     * "NetBSD doesn't have AI_ADDRCONFIG: use it only if it's available."
     * "Use substitition variables in xcb-xinerama.pc.in, not instances of their
        values"
+    * " Fix unit tests for FreeBSD"
   * Add new library, -dev, and -dbg packages for libxcb-xinerama.
 
  -- Josh Triplett <josh at freedesktop.org>  Fri, 24 Nov 2006 00:51:41 -0800
diff --git a/tests/check_public.c b/tests/check_public.c
index a28fb49..e2ebba6 100644
--- a/tests/check_public.c
+++ b/tests/check_public.c
@@ -24,7 +24,7 @@ static void parse_display_pass(const cha
 		if(test_type == TEST_ARGUMENT)
 		{
 			argument = name;
-			putenv("DISPLAY");
+			putenv("DISPLAY=");
 		}
 		else if(test_type == TEST_ENVIRONMENT)
 		{
@@ -49,7 +49,7 @@ static void parse_display_pass(const cha
 		fail_unless(strcmp(host, got_host) == 0, "screenless parse %sproduced unexpected hostname '%s' for '%s': expected '%s'", test_string[test_type], got_host, name, host);
 		fail_unless(display == got_display, "screenless parse %sproduced unexpected display '%d' for '%s': expected '%d'", test_string[test_type], got_display, name, display);
 	}
-	putenv("DISPLAY");
+	putenv("DISPLAY=");
 }
 
 static void parse_display_fail(const char *name)
@@ -65,10 +65,11 @@ static void parse_display_fail(const cha
 		if(test_type == TEST_ARGUMENT)
 		{
 			argument = name;
-			putenv("DISPLAY");
+			putenv("DISPLAY=");
 		}
 		else if(test_type == TEST_ENVIRONMENT)
 		{
+			if (!name) break;
 			argument = 0;
 			setenv("DISPLAY", name, 1);
 		}
@@ -90,7 +91,7 @@ static void parse_display_fail(const cha
 		fail_unless(got_host == (char *) -1, "host changed on parse failure %sfor '%s': got %p", test_string[test_type], name, got_host);
 		fail_unless(got_display == -42, "display changed on parse failure %sfor '%s': got %d", test_string[test_type], name, got_display);
 	}
-	putenv("DISPLAY");
+	putenv("DISPLAY=");
 }
 
 START_TEST(parse_display_unix)
@@ -182,7 +183,7 @@ END_TEST
 Suite *public_suite(void)
 {
 	Suite *s = suite_create("Public API");
-	putenv("DISPLAY");
+	putenv("DISPLAY=");
 	suite_add_test(s, parse_display_unix, "xcb_parse_display unix");
 	suite_add_test(s, parse_display_ip, "xcb_parse_display ip");
 	suite_add_test(s, parse_display_ipv4, "xcb_parse_display ipv4");


More information about the xcb-commit mailing list