1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
4 * Copyright (C) 2011 Free Software Foundation, Inc.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "signature.h"
25 SIGNATURE_CHECK (strtoumax, uintmax_t, (const char *, char **, int));
35 /* Subject sequence empty or invalid. */
37 const char input[] = "";
41 result = strtoumax (input, &ptr, 10);
43 ASSERT (ptr == input);
44 ASSERT (errno == 0 || errno == EINVAL);
47 const char input[] = " ";
51 result = strtoumax (input, &ptr, 10);
53 ASSERT (ptr == input);
54 ASSERT (errno == 0 || errno == EINVAL);
57 const char input[] = " +";
61 result = strtoumax (input, &ptr, 10);
63 ASSERT (ptr == input);
64 ASSERT (errno == 0 || errno == EINVAL);
67 const char input[] = " -";
71 result = strtoumax (input, &ptr, 10);
73 ASSERT (ptr == input);
74 ASSERT (errno == 0 || errno == EINVAL);
77 /* Simple integer values. */
79 const char input[] = "0";
83 result = strtoumax (input, &ptr, 10);
85 ASSERT (ptr == input + 1);
89 const char input[] = "+0";
93 result = strtoumax (input, &ptr, 10);
95 ASSERT (ptr == input + 2);
99 const char input[] = "-0";
103 result = strtoumax (input, &ptr, 10);
104 ASSERT (result == 0);
105 ASSERT (ptr == input + 2);
109 const char input[] = "23";
113 result = strtoumax (input, &ptr, 10);
114 ASSERT (result == 23);
115 ASSERT (ptr == input + 2);
119 const char input[] = " 23";
123 result = strtoumax (input, &ptr, 10);
124 ASSERT (result == 23);
125 ASSERT (ptr == input + 3);
129 const char input[] = "+23";
133 result = strtoumax (input, &ptr, 10);
134 ASSERT (result == 23);
135 ASSERT (ptr == input + 3);
139 const char input[] = "-23";
143 result = strtoumax (input, &ptr, 10);
144 ASSERT (result == - (uintmax_t) 23);
145 ASSERT (ptr == input + 3);