Differences From Artifact [0766971ff5]:
- File
tests/OFSocketTests.m
— part of check-in
[a54730b88f]
at
2022-10-22 18:41:45
on branch trunk
— OFSocket: Don't combine port for IP and IPX
While it works for those two protocols, it's a bad precedent as other
protocols have different types for ports. (user: js, size: 7953) [annotate] [blame] [check-ins using] [more...]
To Artifact [efb70d49d6]:
- File tests/OFSocketTests.m — part of check-in [298619a65f] at 2022-11-07 01:03:38 on branch trunk — OFSocketTests: Add IPv6 address with scope (user: js, size: 8247) [annotate] [blame] [check-ins using] [more...]
︙ | |||
111 112 113 114 115 116 117 118 119 120 121 122 123 124 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | + + + + + + | OFFromBigEndian16(addr.sockaddr.in6.sin6_port) == 1234) TEST(@"Parsing an IPv6 #5", R(addr = OFSocketAddressParseIP(@"::aaAa", 1234)) && COMPARE_V6(addr, 0, 0, 0, 0, 0, 0, 0, 0xAAAA) && OFFromBigEndian16(addr.sockaddr.in6.sin6_port) == 1234) TEST(@"Parsing an IPv6 #6", R(addr = OFSocketAddressParseIP(@"fd00::1%123", 1234)) && COMPARE_V6(addr, 0xFD00, 0, 0, 0, 0, 0, 0, 1) && OFFromBigEndian16(addr.sockaddr.in6.sin6_port) == 1234 && addr.sockaddr.in6.sin6_scope_id == 123) EXPECT_EXCEPTION(@"Refusing invalid IPv6 #1", OFInvalidFormatException, OFSocketAddressParseIP(@"1:::2", 1234)) EXPECT_EXCEPTION(@"Refusing invalid IPv6 #2", OFInvalidFormatException, OFSocketAddressParseIP(@"1: ::2", 1234)) EXPECT_EXCEPTION(@"Refusing invalid IPv6 #3", OFInvalidFormatException, |
︙ | |||
142 143 144 145 146 147 148 149 150 151 152 153 154 155 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | + + | EXPECT_EXCEPTION(@"Refusing invalid IPv6 #9", OFInvalidFormatException, OFSocketAddressParseIP(@"1:2:3:4:5:6:7::", 1234)) EXPECT_EXCEPTION(@"Refusing invalid IPv6 #10", OFInvalidFormatException, OFSocketAddressParseIP(@"1:2", 1234)) TEST(@"Port of an IPv6 address", OFSocketAddressIPPort(&addr) == 1234) addr.sockaddr.in6.sin6_scope_id = 0; SET_V6(addr, 0, 0, 0, 0, 0, 0, 0, 0) TEST(@"Converting an IPv6 to a string #1", [OFSocketAddressString(&addr) isEqual: @"::"]) SET_V6(addr, 0, 0, 0, 0, 0, 0, 0, 1) TEST(@"Converting an IPv6 to a string #2", |
︙ |