Skip to content

Commit

Permalink
Updated testsuite for Netmask.
Browse files Browse the repository at this point in the history
Test Netmask::FromBits for prefixes longer than 32bits.
  • Loading branch information
mchf committed Sep 4, 2013
1 parent f08a505 commit c461fe2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions library/types/testsuite/tests/Netmask.ycp
Expand Up @@ -2,6 +2,7 @@

include "testsuite.ycp";
import "Netmask";
import "Assert";

DUMP("Netmask::Check4");
TEST(``(Netmask::Check4("128.0.0.0")), [], nil);
Expand Down Expand Up @@ -61,6 +62,15 @@ while (i >= 0) {
i = i - 1;
}

// tests that returns empty mask for IPv6 specific prefixes (>32, <=128)
// implementatio of FromBits is IPv4 specific
i = 128;
while( i > 32)
{
Assert::Equal( "", Netmask::FromBits(i) );
i = i - 1;
}

// this test relies on the previous one
DUMP("Netmask::ToBits");
i = 32;
Expand Down

0 comments on commit c461fe2

Please sign in to comment.