2 * Copyright (C) 2003 by Martin Pool
3 * Copyright (C) 2003 by Andrew Bartlett
5 * Test harness for push_ucs2
10 static int check_push_ucs2(const char *orig
)
12 smb_ucs2_t
*dest
= NULL
;
15 size_t converted_size
;
17 push_ucs2_talloc(NULL
, &dest
, orig
, &converted_size
);
18 pull_ucs2_talloc(NULL
, &orig2
, dest
, &converted_size
);
19 ret
= strcmp(orig
, orig2
);
21 fprintf(stderr
, "orig: %s\n", orig
);
22 fprintf(stderr
, "orig (UNIX -> UCS2 -> UNIX): %s\n", orig2
);
31 int main(int argc
, char *argv
[])
36 /* Needed to initialize character set */
37 lp_load("/dev/null", True
, False
, False
, True
);
40 fprintf(stderr
, "usage: %s STRING1 [COUNT]\n"
41 "Checks that a string translated UNIX->UCS2->UNIX is unchanged\n"
42 "Should be always 0\n",
47 count
= atoi(argv
[2]);
49 for (i
= 0; ((i
< count
) && (!ret
)); i
++)
50 ret
= check_push_ucs2(argv
[1]);