summaryrefslogtreecommitdiff
path: root/tests/t_urlencoded.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-26 18:13:27 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-26 18:13:27 +0100
commit78c3cebc389a2b0d426d74900a65b8656edb426d (patch)
tree122003fecc6b53c2dde6393896a852e3689900ff /tests/t_urlencoded.c
parent6837c5ac80e3624c6dc3a82d03e50d68b2f5a989 (diff)
Third run of making variable and function names more readable, integer scans and ip parsers
Diffstat (limited to 'tests/t_urlencoded.c')
-rw-r--r--tests/t_urlencoded.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/t_urlencoded.c b/tests/t_urlencoded.c
index 1239e6b..6e0ee31 100644
--- a/tests/t_urlencoded.c
+++ b/tests/t_urlencoded.c
@@ -228,33 +228,6 @@ static void case_find_keywords(void) {
228 CHECK_INT(urlencoded_match_keyword(keywords, &p, SCAN_SEARCHPATH_PARAM), -3); 228 CHECK_INT(urlencoded_match_keyword(keywords, &p, SCAN_SEARCHPATH_PARAM), -3);
229} 229}
230 230
231static void case_fixed_int(void) {
232 char positive[] = "123";
233 char negative[] = "-45";
234 char trailing[] = "12a";
235 int value;
236
237 test_case("scan_fixed_int returns the count of unparsed bytes");
238 CHECK_INT(scan_fixed_int(positive, 3, &value), 0);
239 CHECK_INT(value, 123);
240
241 CHECK_INT(scan_fixed_int(negative, 3, &value), 0);
242 CHECK_INT(value, -45);
243
244 CHECK_INT(scan_fixed_int(trailing, 3, &value), 1);
245 CHECK_INT(value, 12);
246}
247
248static void case_fixed_int_bounded(void) {
249 char digits[] = "12345";
250 int value;
251
252 test_case("scan_fixed_int honours the length it is given");
253 CHECK_INT(scan_fixed_int(digits, 3, &value), 0);
254 CHECK_INT(value, 123);
255}
256
257
258/* The encoding direction. Which bytes survive unescaped is fixed by what 231/* The encoding direction. Which bytes survive unescaped is fixed by what
259 existing parsers of the urlencoded full scrape expect, so these cases pin 232 existing parsers of the urlencoded full scrape expect, so these cases pin
260 the set rather than describe a preference. */ 233 the set rather than describe a preference. */
@@ -361,8 +334,6 @@ void test_urlencoded(void) {
361 case_raw_high_byte(); 334 case_raw_high_byte();
362 case_skipvalue(); 335 case_skipvalue();
363 case_find_keywords(); 336 case_find_keywords();
364 case_fixed_int();
365 case_fixed_int_bounded();
366 case_fmt_passes_safe_bytes(); 337 case_fmt_passes_safe_bytes();
367 case_fmt_escapes_the_rest(); 338 case_fmt_escapes_the_rest();
368 case_fmt_hex_is_lower_case(); 339 case_fmt_hex_is_lower_case();