ObjFW  Check-in [af0f8118d0]

Overview
Comment:OFIPXSocketTests: Do not compare sender network

It can be different due to IPX internal networks.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: af0f8118d01570398b1d764c97cafc22716817147a5e4a9afdd6f74ec618b144
User & Date: js on 2022-11-06 21:24:30
Other Links: manifest | tags
Context
2022-11-06
21:32
OFBindDDPSocketFailedException: Fix typo check-in: 15e5bfc523 user: js tags: trunk
21:24
OFIPXSocketTests: Do not compare sender network check-in: af0f8118d0 user: js tags: trunk
21:19
Work around an ICE in Clang 3.7.0 on Windows/x86 check-in: 5c0117205d user: js tags: trunk
Changes

Modified tests/OFIPXSocketTests.m from [59b38899e7] to [abf65b2714].

25
26
27
28
29
30
31

32
33
34
35
36
37
38
- (void)IPXSocketTests
{
	const unsigned char zeroNode[IPX_NODE_LEN] = { 0 };
	void *pool = objc_autoreleasePoolPush();
	OFIPXSocket *sock;
	OFSocketAddress address1, address2;
	char buffer[5];


	TEST(@"+[socket]", (sock = [OFIPXSocket socket]))

	@try {
		TEST(@"-[bindToNetwork:node:port:packetType:]",
		R(address1 = [sock bindToNetwork: 0
					    node: zeroNode







>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
- (void)IPXSocketTests
{
	const unsigned char zeroNode[IPX_NODE_LEN] = { 0 };
	void *pool = objc_autoreleasePoolPush();
	OFIPXSocket *sock;
	OFSocketAddress address1, address2;
	char buffer[5];
	unsigned char node1[IPX_NODE_LEN], node2[IPX_NODE_LEN];

	TEST(@"+[socket]", (sock = [OFIPXSocket socket]))

	@try {
		TEST(@"-[bindToNetwork:node:port:packetType:]",
		R(address1 = [sock bindToNetwork: 0
					    node: zeroNode
63
64
65
66
67
68
69



70
71
72
73
74
75

	TEST(@"-[sendBuffer:length:receiver:]",
	    R([sock sendBuffer: "Hello" length: 5 receiver: &address1]))

	TEST(@"-[receiveIntoBuffer:length:sender:]",
	    [sock receiveIntoBuffer: buffer length: 5 sender: &address2] == 5 &&
	    memcmp(buffer, "Hello", 5) == 0 &&



	    OFSocketAddressEqual(&address1, &address2) &&
	    OFSocketAddressHash(&address1) == OFSocketAddressHash(&address2))

	objc_autoreleasePoolPop(pool);
}
@end







>
>
>
|
|




64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

	TEST(@"-[sendBuffer:length:receiver:]",
	    R([sock sendBuffer: "Hello" length: 5 receiver: &address1]))

	TEST(@"-[receiveIntoBuffer:length:sender:]",
	    [sock receiveIntoBuffer: buffer length: 5 sender: &address2] == 5 &&
	    memcmp(buffer, "Hello", 5) == 0 &&
	    R(OFSocketAddressGetIPXNode(&address1, node1)) &&
	    R(OFSocketAddressGetIPXNode(&address2, node2)) &&
	    memcmp(node1, node2, IPX_NODE_LEN) == 0 &&
	    OFSocketAddressIPXPort(&address1) ==
	    OFSocketAddressIPXPort(&address2))

	objc_autoreleasePoolPop(pool);
}
@end