From 854c5d60bd89d5d6a8b4b44c8297e16a425ffb2d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 6 Apr 2003 12:01:44 +0000 Subject: If the string does not convert back, print the buggy result. (This used to be commit 98f76325542c0ab2e0bbcf082a15c6f8db27e37c) --- source3/torture/t_push_ucs2.c | 13 ++++++++++--- 1 file 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); -- cgit