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
;
16 push_ucs2_allocate(&dest
, orig
);
17 pull_ucs2_allocate(&orig2
, dest
);
18 ret
= strcmp(orig
, orig2
);
20 fprintf(stderr
, "orig: %s\n", orig
);
21 fprintf(stderr
, "orig (UNIX -> UCS2 -> UNIX): %s\n", orig2
);
30 int main(int argc
, char *argv
[])
35 /* Needed to initialize character set */
36 lp_load("/dev/null", True
, False
, False
, True
);
39 fprintf(stderr
, "usage: %s STRING1 [COUNT]\n"
40 "Checks that a string translated UNIX->UCS2->UNIX is unchanged\n"
41 "Should be always 0\n",
46 count
= atoi(argv
[2]);
48 for (i
= 0; ((i
< count
) && (!ret
)); i
++)
49 ret
= check_push_ucs2(argv
[1]);