1 /* Test program for the l64a and a64l functions.
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
23 /* Prototype for our test function. */
24 extern int do_test (int argc, char *argv[]);
25 #include <test-skeleton.c>
33 static const struct a64l_test tests[] =
39 { "zzzzz1", 0xffffffff },
40 { "zzzz1", 0x3ffffff },
49 do_test (int argc, char ** argv)
51 const struct a64l_test *at;
56 for (at = tests; at->base64 != NULL; ++at)
58 printf ("a64l (\"%s\")", at->base64);
59 l = a64l (at->base64);
64 printf ("\tBAD\n returns %ld, expected %ld\n", l, at->value);
67 printf ("l64a (%ld)", at->value);
69 if (strcmp (s, at->base64) == 0)
73 printf ("\tBAD\n returns \"%s\", expected \"%s\"\n", s, at->base64);
78 return status ? EXIT_FAILURE : EXIT_SUCCESS;