dbms: add tests for IPv4/6 coding functions. [#METR-13151]

This commit is contained in:
Andrey Mironov 2014-10-31 15:03:13 +03:00
parent 152ca18a21
commit 5465bb3d50
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,9 @@
1
1
1 1
1
1
1
1
1
1

View File

@ -0,0 +1,10 @@
select IPv4StringToNum('') == 0;
select IPv4StringToNum('not an ip string') == 0;
select IPv4StringToNum('127.0.0.1' as p) == (0x7f000001 as n), IPv4NumToString(n) == p;
select IPv4NumToString(toUInt32(0)) == '0.0.0.0';
select IPv6NumToString(toFixedString('', 16)) == '::';
select IPv6NumToString(IPv6StringToNum('::ffff:127.0.0.1' as p) as n) == p;
select IPv6NumToString(toFixedString(unhex('20010DB800000003000001FF0000002E'), 16)) == '2001:db8:0:3:0:1ff:0:2e';
select IPv6StringToNum('') == toFixedString(materialize(''), 16);
select IPv6StringToNum('not an ip string') == toFixedString(materialize(''), 16);