mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
new test
This commit is contained in:
parent
40d01a1b7f
commit
1ae169a5da
@ -88,7 +88,7 @@ inline bool parseIPv4(T * &src, EOFfunction eof, unsigned char * dst, int32_t fi
|
||||
/// returns pointer to the right after parsed sequence or null on failed parsing
|
||||
inline const char * parseIPv4(const char * src, const char * end, unsigned char * dst)
|
||||
{
|
||||
if (parseIPv4(src, [&src, end](){ return src == end; }, dst))
|
||||
if (parseIPv4(src, [&src, end](){ return src == end || *src == '\0'; }, dst))
|
||||
return src;
|
||||
return nullptr;
|
||||
}
|
||||
@ -96,7 +96,8 @@ inline const char * parseIPv4(const char * src, const char * end, unsigned char
|
||||
/// returns true if whole buffer was parsed successfully
|
||||
inline bool parseIPv4whole(const char * src, const char * end, unsigned char * dst)
|
||||
{
|
||||
return parseIPv4(src, end, dst) == reinterpret_cast<const char *>(dst);
|
||||
const char * parsed = parseIPv4(src, end, dst);
|
||||
return parsed-end == 0;
|
||||
}
|
||||
|
||||
/// returns pointer to the right after parsed sequence or null on failed parsing
|
||||
|
@ -31,8 +31,8 @@ ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
127.0.0.1 is ipv4 string: 1
|
||||
8.8.8.8 is ipv4 string: 1
|
||||
hello is ipv4 string: 0
|
||||
192.168.1.1\0000 is ipv4 string: 0
|
||||
192.168.1.1\00dc is ipv4 string: 0
|
||||
192.168.1.1\0000 is ipv4 string: 0
|
||||
192.168.1.1\00dc is ipv4 string: 0
|
||||
0:0:0:0:0:0:0:0 is ipv4 string: 0
|
||||
0000:0000:0000:0000:0000:FFFF:C1FC:110A is ipv4 string: 0
|
||||
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF is ipv4 string: 0
|
||||
|
Loading…
Reference in New Issue
Block a user