summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-06 12:01:44 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-06 12:01:44 +0000
commit854c5d60bd89d5d6a8b4b44c8297e16a425ffb2d (patch)
tree2a3f5270eb32822d81e5e2e49080261af76dbb1c
parentfbd5367245eef1966a5e52adee6f48bfea1dd474 (diff)
downloadsamba-854c5d60bd89d5d6a8b4b44c8297e16a425ffb2d.tar.gz
samba-854c5d60bd89d5d6a8b4b44c8297e16a425ffb2d.tar.bz2
samba-854c5d60bd89d5d6a8b4b44c8297e16a425ffb2d.zip
If the string does not convert back, print the buggy result.
(This used to be commit 98f76325542c0ab2e0bbcf082a15c6f8db27e37c)
-rw-r--r--source3/torture/t_push_ucs2.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/torture/t_push_ucs2.c b/source3/torture/t_push_ucs2.c
index 0ab17983a0..ca04394acc 100644
--- a/source3/torture/t_push_ucs2.c
+++ b/source3/torture/t_push_ucs2.c
@@ -16,22 +16,29 @@ static int check_push_ucs2(const char *orig)
push_ucs2_allocate(&dest, orig);
pull_ucs2_allocate(&orig2, dest);
ret = strcmp(orig, orig2);
+ if (ret) {
+ fprintf(stderr, "orig: %s\n", orig);
+ fprintf(stderr, "orig (UNIX -> UCS2 -> UNIX): %s\n", orig2);
+ }
+
SAFE_FREE(dest);
SAFE_FREE(orig2);
+
+ return ret;
}
int main(int argc, char *argv[])
{
- int i, ret;
+ int i, ret = 0;
if (argc != 2) {
fprintf(stderr, "usage: %s STRING1\n"
- "Converts a string, prints the results of memcmp\n",
+ "Converts a string, prints the results of strcmp\n",
argv[0]);
return 2;
}
- for (i = 0; i < 10000; i++)
+ for (i = 0; ((i < 10000) && (!ret)); i++)
ret = check_push_ucs2(argv[1]);
printf("%d\n", ret);