Lines Matching refs:val
377 uint32_t val; in test_safe_strtoul() local
378 assert(safe_strtoul("123", &val)); in test_safe_strtoul()
379 assert(val == 123); in test_safe_strtoul()
380 assert(safe_strtoul("+123", &val)); in test_safe_strtoul()
381 assert(val == 123); in test_safe_strtoul()
382 assert(!safe_strtoul("", &val)); // empty in test_safe_strtoul()
383 assert(!safe_strtoul("123BOGUS", &val)); // non-numeric in test_safe_strtoul()
384 assert(!safe_strtoul(" issue221", &val)); // non-numeric in test_safe_strtoul()
390 assert(safe_strtoul("4294967295", &val)); // 2**32 - 1 in test_safe_strtoul()
391 assert(val == 4294967295L); in test_safe_strtoul()
395 assert(!safe_strtoul("-1", &val)); // negative in test_safe_strtoul()
399 assert(safe_strtoul("18446744073709551615\r\nextrastring-morestring", &val)); in test_safe_strtoul()
401 assert(safe_strtoul("4294967295\r\nextrastring-morestring", &val)); in test_safe_strtoul()
409 uint64_t val; in test_safe_strtoull() local
410 assert(safe_strtoull("123", &val)); in test_safe_strtoull()
411 assert(val == 123); in test_safe_strtoull()
412 assert(safe_strtoull("+123", &val)); in test_safe_strtoull()
413 assert(val == 123); in test_safe_strtoull()
414 assert(!safe_strtoull("", &val)); // empty in test_safe_strtoull()
415 assert(!safe_strtoull("123BOGUS", &val)); // non-numeric in test_safe_strtoull()
416 assert(!safe_strtoull("92837498237498237498029383", &val)); // out of range in test_safe_strtoull()
417 assert(!safe_strtoull(" issue221", &val)); // non-numeric in test_safe_strtoull()
420 assert(safe_strtoull("18446744073709551615", &val)); // 2**64 - 1 in test_safe_strtoull()
421 assert(val == 18446744073709551615ULL); in test_safe_strtoull()
422 assert(!safe_strtoull("18446744073709551616", &val)); // 2**64 in test_safe_strtoull()
423 assert(!safe_strtoull("-1", &val)); // negative in test_safe_strtoull()
426 assert(safe_strtoull("18446744073709551615\r\nextrastring-morestring", &val)); in test_safe_strtoull()
431 int64_t val; in test_safe_strtoll() local
432 assert(safe_strtoll("123", &val)); in test_safe_strtoll()
433 assert(val == 123); in test_safe_strtoll()
434 assert(safe_strtoll("+123", &val)); in test_safe_strtoll()
435 assert(val == 123); in test_safe_strtoll()
436 assert(safe_strtoll("-123", &val)); in test_safe_strtoll()
437 assert(val == -123); in test_safe_strtoll()
438 assert(!safe_strtoll("", &val)); // empty in test_safe_strtoll()
439 assert(!safe_strtoll("123BOGUS", &val)); // non-numeric in test_safe_strtoll()
440 assert(!safe_strtoll("92837498237498237498029383", &val)); // out of range in test_safe_strtoll()
441 assert(!safe_strtoll(" issue221", &val)); // non-numeric in test_safe_strtoll()
444 assert(!safe_strtoll("18446744073709551615", &val)); // 2**64 - 1 in test_safe_strtoll()
445 assert(safe_strtoll("9223372036854775807", &val)); // 2**63 - 1 in test_safe_strtoll()
446 assert(val == 9223372036854775807LL); in test_safe_strtoll()
451 assert(!safe_strtoll("-9223372036854775809", &val)); // -2**63 - 1 in test_safe_strtoll()
454 assert(safe_strtoll(" 123 foo", &val)); in test_safe_strtoll()
455 assert(val == 123); in test_safe_strtoll()
460 int32_t val; in test_safe_strtol() local
461 assert(safe_strtol("123", &val)); in test_safe_strtol()
462 assert(val == 123); in test_safe_strtol()
463 assert(safe_strtol("+123", &val)); in test_safe_strtol()
464 assert(val == 123); in test_safe_strtol()
465 assert(safe_strtol("-123", &val)); in test_safe_strtol()
466 assert(val == -123); in test_safe_strtol()
467 assert(!safe_strtol("", &val)); // empty in test_safe_strtol()
468 assert(!safe_strtol("123BOGUS", &val)); // non-numeric in test_safe_strtol()
469 assert(!safe_strtol("92837498237498237498029383", &val)); // out of range in test_safe_strtol()
470 assert(!safe_strtol(" issue221", &val)); // non-numeric in test_safe_strtol()
476 assert(safe_strtol("2147483647", &val)); // (- (expt 2.0 31) 1) in test_safe_strtol()
477 assert(val == 2147483647L); in test_safe_strtol()
483 assert(safe_strtol(" 123 foo", &val)); in test_safe_strtol()
484 assert(val == 123); in test_safe_strtol()
597 int32_t val; in start_server() local
598 assert(safe_strtol(buffer + 10, &val)); in start_server()
599 *port_out = (in_port_t)val; in start_server()
627 int32_t val; in start_server() local
628 assert(safe_strtol(buffer, &val)); in start_server()
629 pid = (pid_t)val; in start_server()
977 uint8_t val = *ptr; in safe_send() local
978 assert(val == (uint8_t)0x80); in safe_send()
984 val = *(ptr + ii); in safe_send()
985 fprintf(stderr, " 0x%02x", val); in safe_send()
1059 uint8_t val = *ptr; in safe_recv_packet() local
1060 assert(val == (uint8_t)0x81); in safe_recv_packet()
1066 val = *(ptr + ii); in safe_recv_packet()
1067 fprintf(stderr, " 0x%02x", val); in safe_recv_packet()