r16447: print the result of talloc_set_parent()
authorStefan Metzmacher <metze@samba.org>
Wed, 21 Jun 2006 20:28:51 +0000 (20:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:09:15 +0000 (14:09 -0500)
trying to find the bug on HPUX

metze
(This used to be commit 3db6bd87158cd615a3e35009598863758099595b)

source4/lib/talloc/testsuite.c

index 10810f30e96a2e9afd091eed0d03a6a4ea74a505..477d9a5848978f4f52b5b7546511700a9fb1dc3d 100644 (file)
@@ -351,6 +351,7 @@ static BOOL test_misc(void)
        void *root, *p1;
        char *p2;
        double *d;
+       const char *name;
 
        printf("TESTING MISCELLANEOUS\n");
 
@@ -387,10 +388,10 @@ static BOOL test_misc(void)
        CHECK_BLOCKS(p1, 1);
        CHECK_BLOCKS(root, 2);
 
-       talloc_set_name(p1, "my name is %s", "foo");
+       name = talloc_set_name(p1, "my name is %s", "foo");
        if (strcmp(talloc_get_name(p1), "my name is foo") != 0) {
-               printf("failed: wrong name after talloc_set_name(my name is foo) - '%s'\n",
-                       talloc_get_name(p1));
+               printf("failed: wrong name after talloc_set_name(my name is foo) - '%s'=>'%s'\n",
+                       (name?name:"NULL"), talloc_get_name(p1));
                return False;
        }
        CHECK_BLOCKS(p1, 2);