The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
token_tests.c
Go to the documentation of this file.
1/*
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15 */
16
17/** Tests for the configuration file tokenizer
18 *
19 * @file src/lib/util/test/token_tests.c
20 *
21 * @copyright 2026 The FreeRADIUS server project
22 */
23#include "acutest_common_init.h"
24#include "acutest_helpers.h"
25
26#include <freeradius-devel/util/token.h>
27
28#include <sys/mman.h>
29
30/** Where a parse ran, and what the parse produced
31 *
32 */
33typedef struct {
34 fr_token_t token; //!< what the parse function returned.
35 int rcode; //!< what getword() returned, which is not a token.
36 char buf[256]; //!< what the parse function wrote.
37 size_t used; //!< how many bytes of the input the parse consumed.
39
40/** Copy a string so that the terminating NUL is the last readable byte
41 *
42 * A read past the NUL lands on an unreadable page and faults, rather than returning
43 * whatever byte happens to follow the string. Every parse in this file runs against a
44 * guarded copy, because a tokenizer which reads one byte too far produces the right answer
45 * on almost every run and the wrong answer on the rest.
46 *
47 * @param[out] base start of the mapping, to pass to guard_free().
48 * @param[in] in to copy.
49 * @return the copy, positioned against the unreadable page.
50 */
51static char *guard_alloc(char **base, char const *in)
52{
53 size_t len = strlen(in);
54 size_t pagesz = test_page_size();
55 char *p;
56
57 *base = mmap(NULL, pagesz * 2, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
58 if (*base == MAP_FAILED) return NULL;
59
60 if (mprotect(*base + pagesz, pagesz, PROT_NONE) < 0) return NULL;
61
62 p = *base + pagesz - (len + 1);
63 memcpy(p, in, len + 1);
64
65 return p;
66}
67
68static void guard_free(char *base)
69{
70 munmap(base, test_page_size() * 2);
71}
72
73/** Run gettoken() over a guarded copy of the input
74 *
75 */
76static parse_result_t test_gettoken(char const *in, bool unescape)
77{
78 parse_result_t result = {};
79 char *base, *start;
80 char const *p;
81
82 start = guard_alloc(&base, in);
83 TEST_ASSERT(start != NULL);
84
85 p = start;
86 result.token = gettoken(&p, result.buf, sizeof(result.buf), unescape);
87 result.used = (size_t) (p - start);
88
89 guard_free(base);
90
91 return result;
92}
93
94/** Run getword() over a guarded copy of the input
95 *
96 * getword() returns 0 at end of line and 1 otherwise. The return value goes in `rcode`.
97 */
98static parse_result_t test_getword(char const *in, bool unescape)
99{
100 parse_result_t result = {};
101 char *base, *start;
102 char const *p;
103
104 start = guard_alloc(&base, in);
105 TEST_ASSERT(start != NULL);
106
107 p = start;
108 result.rcode = getword(&p, result.buf, sizeof(result.buf), unescape);
109 result.used = (size_t) (p - start);
110
111 guard_free(base);
112
113 return result;
114}
115
116/** Run getstring() over a guarded copy of the input
117 *
118 */
119static parse_result_t test_getstring(char const *in, bool unescape)
120{
121 parse_result_t result = {};
122 char *base, *start;
123 char const *p;
124
125 start = guard_alloc(&base, in);
126 TEST_ASSERT(start != NULL);
127
128 p = start;
129 result.token = getstring(&p, result.buf, sizeof(result.buf), unescape);
130 result.used = (size_t) (p - start);
131
132 guard_free(base);
133
134 return result;
135}
136
137/** Run getop() over a guarded copy of the input
138 *
139 */
140static parse_result_t test_getop(char const *in)
141{
142 parse_result_t result = {};
143 char *base, *start;
144 char const *p;
145
146 start = guard_alloc(&base, in);
147 TEST_ASSERT(start != NULL);
148
149 p = start;
150 result.token = getop(&p);
151 result.used = (size_t) (p - start);
152
153 guard_free(base);
154
155 return result;
156}
157
158#define TEST_PARSE_BUF(_result, _buf, _used) do { \
159 TEST_CHECK(strcmp((_result).buf, (_buf)) == 0); \
160 TEST_MSG("buf: got \"%s\", expected \"%s\"", (_result).buf, (_buf)); \
161 TEST_CHECK((_result).used == (size_t) (_used)); \
162 TEST_MSG("used: got %zu, expected %zu", (_result).used, (size_t) (_used)); \
163} while (0)
164
165#define TEST_PARSE(_result, _token, _buf, _used) do { \
166 parse_result_t _r = (_result); \
167 TEST_CHECK(_r.token == (_token)); \
168 TEST_MSG("token: got %u, expected %u", _r.token, (fr_token_t)(_token)); \
169 TEST_PARSE_BUF(_r, _buf, _used); \
170} while (0)
171
172#define TEST_PARSE_WORD(_result, _rcode, _buf, _used) do { \
173 parse_result_t _r = (_result); \
174 TEST_CHECK(_r.rcode == (_rcode)); \
175 TEST_MSG("rcode: got %d, expected %d", _r.rcode, (_rcode)); \
176 TEST_PARSE_BUF(_r, _buf, _used); \
177} while (0)
178
179/** A triple-quoted string keeps every character between the delimiters
180 *
181 * Skipping three characters for the opening delimiter and then one more ate the first
182 * character of the content. For an input of three quotes and nothing else, the same extra
183 * skip stepped past the terminating NUL.
184 */
185static void test_triple_quote(void)
186{
187 TEST_PARSE(test_gettoken("\"\"\"abc\"\"\"", true), T_DOUBLE_QUOTED_STRING, "abc", 9);
188 TEST_PARSE(test_gettoken("'''abc'''", true), T_SINGLE_QUOTED_STRING, "abc", 9);
189 TEST_PARSE(test_gettoken("```abc```", true), T_BACK_QUOTED_STRING, "abc", 9);
190
191 /*
192 * A triple-quoted string holds quotes which a single-quoted string cannot.
193 */
194 TEST_PARSE(test_gettoken("\"\"\"a\"b\"\"\"", true), T_DOUBLE_QUOTED_STRING, "a\"b", 9);
195
196 /*
197 * Three quotes and nothing else open a string which never ends.
198 */
199 TEST_PARSE(test_gettoken("\"\"\"", true), T_INVALID, "", 0);
200 TEST_PARSE(test_gettoken("\"\"\"abc", true), T_INVALID, "abc", 0);
201
202 /*
203 * Two quotes are an empty string, and are not a triple quote.
204 */
205 TEST_PARSE(test_gettoken("\"\"", true), T_DOUBLE_QUOTED_STRING, "", 2);
206}
207
208/** gettoken() splits on the tokens in the token table
209 *
210 */
212{
213 TEST_PARSE(test_gettoken("hello", true), T_BARE_WORD, "hello", 5);
214
215 /*
216 * The delimiter is left for the next call to read.
217 */
218 TEST_PARSE(test_gettoken("a,b", true), T_BARE_WORD, "a", 1);
219 TEST_PARSE(test_gettoken("a==b", true), T_BARE_WORD, "a", 1);
220 TEST_PARSE(test_gettoken("a b", true), T_BARE_WORD, "a", 2);
221
222 /*
223 * A token which starts the input is returned as that token.
224 */
225 TEST_PARSE(test_gettoken("{", true), T_LCBRACE, "{", 1);
226 TEST_PARSE(test_gettoken("}", true), T_RCBRACE, "}", 1);
227 TEST_PARSE(test_gettoken(",", true), T_COMMA, ",", 1);
228 TEST_PARSE(test_gettoken("==", true), T_OP_CMP_EQ, "==", 2);
229
230 /*
231 * Leading whitespace is skipped, and so is trailing whitespace.
232 */
233 TEST_PARSE(test_gettoken(" abc ", true), T_BARE_WORD, "abc", 9);
234
235 /*
236 * Nothing to read, and whitespace with nothing after it, are both end of line.
237 */
238 TEST_PARSE(test_gettoken("", true), T_EOL, "", 0);
239 TEST_PARSE(test_gettoken(" ", true), T_EOL, "", 3);
240}
241
242/** Each quote character produces its own token type
243 *
244 */
245static void test_gettoken_quotes(void)
246{
247 TEST_PARSE(test_gettoken("\"a b\"", true), T_DOUBLE_QUOTED_STRING, "a b", 5);
248 TEST_PARSE(test_gettoken("'a b'", true), T_SINGLE_QUOTED_STRING, "a b", 5);
249 TEST_PARSE(test_gettoken("`a b`", true), T_BACK_QUOTED_STRING, "a b", 5);
250
251 /*
252 * A quoted string holds the token characters which would otherwise split the input.
253 */
254 TEST_PARSE(test_gettoken("\"a,b==c\"", true), T_DOUBLE_QUOTED_STRING, "a,b==c", 8);
255
256 /*
257 * An empty quoted string is still a string.
258 */
260}
261
262/** gettoken() turns escape sequences into the characters the sequences name
263 *
264 */
265static void test_gettoken_unescape(void)
266{
267 TEST_PARSE(test_gettoken("\"a\\nb\"", true), T_DOUBLE_QUOTED_STRING, "a\nb", 6);
268 TEST_PARSE(test_gettoken("\"a\\rb\"", true), T_DOUBLE_QUOTED_STRING, "a\rb", 6);
269 TEST_PARSE(test_gettoken("\"a\\tb\"", true), T_DOUBLE_QUOTED_STRING, "a\tb", 6);
270
271 /*
272 * Three octal digits are one character. 101 octal is 'A'.
273 */
274 TEST_PARSE(test_gettoken("\"a\\101b\"", true), T_DOUBLE_QUOTED_STRING, "aAb", 8);
275
276 TEST_PARSE(test_gettoken("\"a\\1bc\"", true), T_DOUBLE_QUOTED_STRING, "a1bc", 7);
277 TEST_PARSE(test_gettoken("\"a\\777b\"", true), T_DOUBLE_QUOTED_STRING, "a777b", 8);
278
279 /*
280 * An escaped quote does not end the string.
281 */
282 TEST_PARSE(test_gettoken("\"a\\\"b\"", true), T_DOUBLE_QUOTED_STRING, "a\"b", 6);
283
284 /*
285 * A backslash in front of anything else yields that character.
286 */
287 TEST_PARSE(test_gettoken("\"a\\qb\"", true), T_DOUBLE_QUOTED_STRING, "aqb", 6);
288 TEST_PARSE(test_gettoken("\"a\\\\b\"", true), T_DOUBLE_QUOTED_STRING, "a\\b", 6);
289}
290
291/** Without unescaping, gettoken() keeps the backslash
292 *
293 * The one exception is a backslash in front of the quote character, which the tokenizer
294 * still has to remove so that the quote does not end the string.
295 */
297{
298 TEST_PARSE(test_gettoken("\"a\\nb\"", false), T_DOUBLE_QUOTED_STRING, "a\\nb", 6);
299 TEST_PARSE(test_gettoken("\"a\\101b\"", false), T_DOUBLE_QUOTED_STRING, "a\\101b", 8);
300
301 TEST_PARSE(test_gettoken("\"a\\\"b\"", false), T_DOUBLE_QUOTED_STRING, "a\"b", 6);
302}
303
304/** A string which never ends is an error, and the input pointer does not move
305 *
306 */
308{
309 TEST_PARSE(test_gettoken("\"abc", true), T_INVALID, "abc", 0);
310 TEST_PARSE(test_gettoken("'abc", true), T_INVALID, "abc", 0);
311
312 /*
313 * The closing quote is escaped, so the string still never ends.
314 */
315 TEST_PARSE(test_gettoken("\"abc\\\"", true), T_INVALID, "abc\"", 0);
316
317 /*
318 * A backslash with nothing after it is an error rather than an escape. getthing()
319 * terminates the output buffer before returning, so the caller may read the buffer
320 * even on the error paths.
321 */
322 TEST_PARSE(test_gettoken("\"abc\\", true), T_INVALID, "abc", 0);
323}
324
325/** An input longer than the output buffer stops at the end of the output buffer
326 *
327 */
329{
330 char buf[4];
331 char *base, *start;
332 char const *p;
333 fr_token_t token;
334
335 /*
336 * A bare word is truncated to the space available, and is not an error.
337 */
338 start = guard_alloc(&base, "abcdefgh");
339 TEST_ASSERT(start != NULL);
340 p = start;
341 token = gettoken(&p, buf, sizeof(buf), true);
342 TEST_CHECK(token == T_BARE_WORD);
343 TEST_CHECK(strcmp(buf, "abc") == 0);
344 TEST_MSG("got \"%s\"", buf);
345 guard_free(base);
346
347 /*
348 * A quoted string is an error, because the closing quote is never reached.
349 */
350 start = guard_alloc(&base, "\"abcdefgh\"");
351 TEST_ASSERT(start != NULL);
352 p = start;
353 token = gettoken(&p, buf, sizeof(buf), true);
354 TEST_CHECK(token == T_INVALID);
355 TEST_MSG("got token %u", token);
356 guard_free(base);
357}
358
359/** getword() reads to whitespace, and ignores the tokens which split gettoken()
360 *
361 */
363{
364 /*
365 * getword() returns 1 when the call read a word, and 0 at end of line.
366 */
367 TEST_PARSE_WORD(test_getword("hello", true), 1, "hello", 5);
368
369 /*
370 * gettoken() stops at the "==". getword() does not.
371 */
372 TEST_PARSE_WORD(test_getword("a==b", true), 1, "a==b", 4);
373 TEST_PARSE_WORD(test_getword("a;b", true), 1, "a;b", 3);
374
375 /*
376 * The comma is the exception. getthing() tests for the comma outside the block
377 * which tests the token list, so the comma ends a word for getword() as well as for
378 * gettoken().
379 */
380 TEST_PARSE_WORD(test_getword("a,b", true), 1, "a", 1);
381
382 /*
383 * Whitespace still ends the word.
384 */
385 TEST_PARSE_WORD(test_getword("a b", true), 1, "a", 2);
386
387 TEST_PARSE_WORD(test_getword("", true), 0, "", 0);
388
389 /*
390 * getword() reads quoted strings, which is the path that $TEMPLATE uses.
391 */
392 TEST_PARSE_WORD(test_getword("\"a b\"", true), 1, "a b", 5);
393 TEST_PARSE_WORD(test_getword("\"\"\"abc\"\"\"", true), 1, "abc", 9);
394}
395
396/** getop() accepts an assignment or comparison operator and rejects everything else
397 *
398 */
399static void test_getop_operators(void)
400{
401 TEST_CHECK(test_getop("=").token == T_OP_EQ);
402 TEST_CHECK(test_getop(":=").token == T_OP_SET);
403 TEST_CHECK(test_getop("+=").token == T_OP_ADD_EQ);
404 TEST_CHECK(test_getop("-=").token == T_OP_SUB_EQ);
405 TEST_CHECK(test_getop("==").token == T_OP_CMP_EQ);
406 TEST_CHECK(test_getop("!=").token == T_OP_NE);
407 TEST_CHECK(test_getop("<=").token == T_OP_LE);
408 TEST_CHECK(test_getop(">=").token == T_OP_GE);
409 TEST_CHECK(test_getop("=~").token == T_OP_REG_EQ);
410 TEST_CHECK(test_getop("!~").token == T_OP_REG_NE);
411
412 /*
413 * A word is not an operator, and neither is a brace.
414 */
415 TEST_CHECK(test_getop("hello").token == T_INVALID);
416 TEST_CHECK(test_getop("{").token == T_INVALID);
417 TEST_CHECK(test_getop("").token == T_INVALID);
418}
419
420/** getstring() reads a quoted string as a string, and anything else as a word
421 *
422 */
423static void test_getstring_quoting(void)
424{
425 TEST_PARSE(test_getstring("\"a b\"", true), T_DOUBLE_QUOTED_STRING, "a b", 5);
426 TEST_PARSE(test_getstring("'a b'", true), T_SINGLE_QUOTED_STRING, "a b", 5);
427 TEST_PARSE(test_getstring("`a b`", true), T_BACK_QUOTED_STRING, "a b", 5);
428
429 /*
430 * An unquoted string reaches getthing() with the token list turned off, so the
431 * tokens which split gettoken() do not split getstring().
432 */
433 TEST_PARSE(test_getstring("a=b", true), T_BARE_WORD, "a=b", 3);
434
435 TEST_PARSE(test_getstring("a b", true), T_BARE_WORD, "a", 2);
436 TEST_PARSE(test_getstring("", true), T_EOL, "", 0);
437}
438
439/** getstring() rejects a NULL pointer rather than following the pointer
440 *
441 */
442static void test_getstring_null(void)
443{
444 char buf[16];
445 char const *p = NULL;
446
447 TEST_CHECK(getstring(NULL, buf, sizeof(buf), true) == T_INVALID);
448 TEST_CHECK(getstring(&p, buf, sizeof(buf), true) == T_INVALID);
449
450 p = "hello";
451 TEST_CHECK(getstring(&p, NULL, 16, true) == T_INVALID);
452}
453
454/** fr_token_name() names the tokens which the tokenizer matches as tokens
455 *
456 * The word and string tokens are not in that table, so fr_token_name() does not name the
457 * word and string tokens. Use fr_token_to_enum_str() for those.
458 */
459static void test_token_name(void)
460{
461 TEST_CHECK(strcmp(fr_token_name(T_OP_EQ), "=") == 0);
462 TEST_CHECK(strcmp(fr_token_name(T_LCBRACE), "{") == 0);
463 TEST_CHECK(strcmp(fr_token_name(T_OP_CMP_EQ), "==") == 0);
464
465 TEST_CHECK(strcmp(fr_token_name(T_BARE_WORD), "<INVALID>") == 0);
466 TEST_CHECK(strcmp(fr_token_name(9999), "<INVALID>") == 0);
467 TEST_CHECK(strcmp(fr_token_name(-1), "<INVALID>") == 0);
468}
469
470/** fr_token_to_enum_str() names a token with the name of the C enumeration value
471 *
472 */
473static void test_token_to_enum_str(void)
474{
475 TEST_CHECK(strcmp(fr_token_to_enum_str(T_OP_EQ), "T_OP_EQ") == 0);
476 TEST_CHECK(strcmp(fr_token_to_enum_str(T_BARE_WORD), "T_BARE_WORD") == 0);
477 TEST_CHECK(strcmp(fr_token_to_enum_str(T_DOUBLE_QUOTED_STRING), "T_DOUBLE_QUOTED_STRING") == 0);
478}
479
480/** fr_token_from_quote_enum_str() turns an enumeration name back into a token
481 *
482 */
484{
490
491 /*
492 * The table holds the quote tokens only, so an operator name is not in the table.
493 */
495
496 /*
497 * An unknown name and a NULL name both return the default which the caller gave.
498 */
502}
503
505 { "triple_quote", test_triple_quote },
506 { "gettoken_delimiters", test_gettoken_delimiters },
507 { "gettoken_quotes", test_gettoken_quotes },
508 { "gettoken_unescape", test_gettoken_unescape },
509 { "gettoken_no_unescape", test_gettoken_no_unescape },
510 { "gettoken_unterminated", test_gettoken_unterminated },
511 { "gettoken_truncation", test_gettoken_truncation },
512 { "getword_no_delimiters", test_getword_no_delimiters },
513 { "getop_operators", test_getop_operators },
514 { "getstring_quoting", test_getstring_quoting },
515 { "getstring_null", test_getstring_null },
516 { "token_name", test_token_name },
517 { "token_to_enum_str", test_token_to_enum_str },
518 { "token_from_quote_enum_str", test_token_from_quote_enum_str },
519
521};
#define TEST_CHECK(cond)
Definition acutest.h:101
#define TEST_ASSERT(cond)
Definition acutest.h:125
#define TEST_TERMINATOR
Definition acutest.h:77
#define TEST_MSG(...)
Definition acutest.h:234
Common initialisation for acutest binaries.
static size_t test_page_size(void)
Return the system page size, aborting the test if sysconf() fails.
unsigned long int size_t
char const * fr_token_name(int token)
Definition token.c:579
fr_token_t getstring(char const **ptr, char *buf, size_t buflen, bool unescape)
Definition token.c:560
char const * fr_token_to_enum_str(fr_token_t t)
Return the source-identifier name for a token (e.g.
Definition token.c:117
int getword(char const **ptr, char *buf, size_t buflen, bool unescape)
Definition token.c:527
fr_token_t getop(char const **ptr)
Definition token.c:544
fr_token_t fr_token_from_quote_enum_str(char const *s, fr_token_t dflt)
Look up a quote token by its source-identifier name.
Definition token.c:137
fr_token_t gettoken(char const **ptr, char *buf, size_t buflen, bool unescape)
Definition token.c:536
@ T_OP_SUB_EQ
Definition token.h:68
@ T_INVALID
Definition token.h:37
@ T_RCBRACE
Definition token.h:40
@ T_EOL
Definition token.h:38
@ T_SINGLE_QUOTED_STRING
Definition token.h:120
@ T_BARE_WORD
Definition token.h:118
@ T_OP_EQ
Definition token.h:81
@ T_BACK_QUOTED_STRING
Definition token.h:121
@ T_OP_SET
Definition token.h:82
@ T_OP_NE
Definition token.h:95
@ T_OP_ADD_EQ
Definition token.h:67
@ T_LCBRACE
Definition token.h:39
@ T_OP_REG_EQ
Definition token.h:100
@ T_DOUBLE_QUOTED_STRING
Definition token.h:119
@ T_OP_CMP_EQ
Definition token.h:104
@ T_OP_LE
Definition token.h:98
@ T_OP_GE
Definition token.h:96
@ T_SOLIDUS_QUOTED_STRING
Definition token.h:122
@ T_OP_REG_NE
Definition token.h:101
@ T_COMMA
Definition token.h:43
enum fr_token fr_token_t
static void test_gettoken_unescape(void)
gettoken() turns escape sequences into the characters the sequences name
TEST_LIST
static void test_getstring_null(void)
getstring() rejects a NULL pointer rather than following the pointer
#define TEST_PARSE_WORD(_result, _rcode, _buf, _used)
static void test_token_name(void)
fr_token_name() names the tokens which the tokenizer matches as tokens
static void test_gettoken_truncation(void)
An input longer than the output buffer stops at the end of the output buffer.
static void test_token_from_quote_enum_str(void)
fr_token_from_quote_enum_str() turns an enumeration name back into a token
size_t used
how many bytes of the input the parse consumed.
Definition token_tests.c:37
static void test_gettoken_delimiters(void)
gettoken() splits on the tokens in the token table
static void test_getop_operators(void)
getop() accepts an assignment or comparison operator and rejects everything else
static parse_result_t test_getstring(char const *in, bool unescape)
Run getstring() over a guarded copy of the input.
int rcode
what getword() returned, which is not a token.
Definition token_tests.c:35
static void test_gettoken_no_unescape(void)
Without unescaping, gettoken() keeps the backslash.
fr_token_t token
what the parse function returned.
Definition token_tests.c:34
static void test_getword_no_delimiters(void)
getword() reads to whitespace, and ignores the tokens which split gettoken()
static void test_triple_quote(void)
A triple-quoted string keeps every character between the delimiters.
static void guard_free(char *base)
Definition token_tests.c:68
static parse_result_t test_gettoken(char const *in, bool unescape)
Run gettoken() over a guarded copy of the input.
Definition token_tests.c:76
static void test_gettoken_quotes(void)
Each quote character produces its own token type.
static char * guard_alloc(char **base, char const *in)
Copy a string so that the terminating NUL is the last readable byte.
Definition token_tests.c:51
#define TEST_PARSE(_result, _token, _buf, _used)
static void test_gettoken_unterminated(void)
A string which never ends is an error, and the input pointer does not move.
char buf[256]
what the parse function wrote.
Definition token_tests.c:36
static parse_result_t test_getword(char const *in, bool unescape)
Run getword() over a guarded copy of the input.
Definition token_tests.c:98
static void test_token_to_enum_str(void)
fr_token_to_enum_str() names a token with the name of the C enumeration value
static void test_getstring_quoting(void)
getstring() reads a quoted string as a string, and anything else as a word
static parse_result_t test_getop(char const *in)
Run getop() over a guarded copy of the input.
Where a parse ran, and what the parse produced.
Definition token_tests.c:33
static fr_sbuff_err_t char size_t fr_sbuff_t * in
Definition value.h:1061
static fr_sbuff_err_t char size_t * len
Definition value.h:1061