ObjFW  Check-in [51a7aea28e]

Overview
Comment:tests: Use /tmp for UNIX sockets on iOS

temporaryDirectoryPath is too long on the simulator.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 51a7aea28e945aa9819b550614129acfd44c2c99d99041eb4dbd7f1918f2710e
User & Date: js on 2022-04-24 11:58:03
Other Links: manifest | tags
Context
2022-04-25
12:58
tests/iOS.xcodeproj: Update to latest Xcode check-in: ab3885c7ee user: js tags: trunk
2022-04-24
11:58
tests: Use /tmp for UNIX sockets on iOS check-in: 51a7aea28e user: js tags: trunk
11:52
ObjFW.h: Fix missing import check-in: 04c6001659 user: js tags: trunk
Changes

Modified tests/OFUNIXDatagramSocketTests.m from [2f01148368] to [a9dd0b5f94].

26
27
28
29
30
31
32
33
34
35
36
37
38
39



40
41
42
43
44
45
46
{
	void *pool = objc_autoreleasePoolPush();
	OFString *path;
	OFUNIXDatagramSocket *sock;
	OFSocketAddress address1, address2;
	char buffer[5];

#ifdef OF_HAVE_FILES
	path = [[OFSystemInfo temporaryDirectoryPath]
	    stringByAppendingPathComponent: [[OFUUID UUID] UUIDString]];
#else
	/*
	 * We can have sockets, including UNIX sockets, while file support is
	 * disabled.



	 */
	path = [OFString stringWithFormat: @"/tmp/%@",
					   [[OFUUID UUID] UUIDString]];
#endif

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








|






>
>
>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
	void *pool = objc_autoreleasePoolPush();
	OFString *path;
	OFUNIXDatagramSocket *sock;
	OFSocketAddress address1, address2;
	char buffer[5];

#if defined(OF_HAVE_FILES) && !defined(OF_IOS)
	path = [[OFSystemInfo temporaryDirectoryPath]
	    stringByAppendingPathComponent: [[OFUUID UUID] UUIDString]];
#else
	/*
	 * We can have sockets, including UNIX sockets, while file support is
	 * disabled.
	 *
	 * We also use this code path for iOS, as the temporaryDirectoryPath is
	 * too long on the iOS simulator.
	 */
	path = [OFString stringWithFormat: @"/tmp/%@",
					   [[OFUUID UUID] UUIDString]];
#endif

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

Modified tests/OFUNIXStreamSocketTests.m from [c984b431f1] to [40030e8cdb].

25
26
27
28
29
30
31
32
33
34
35
36
37
38



39
40
41
42
43
44
45
- (void)UNIXStreamSocketTests
{
	void *pool = objc_autoreleasePoolPush();
	OFString *path;
	OFUNIXStreamSocket *sockClient, *sockServer, *sockAccepted;
	char buffer[5];

#ifdef OF_HAVE_FILES
	path = [[OFSystemInfo temporaryDirectoryPath]
	    stringByAppendingPathComponent: [[OFUUID UUID] UUIDString]];
#else
	/*
	 * We can have sockets, including UNIX sockets, while file support is
	 * disabled.



	 */
	path = [OFString stringWithFormat: @"/tmp/%@",
					   [[OFUUID UUID] UUIDString]];
#endif

	TEST(@"+[socket]", (sockClient = [OFUNIXStreamSocket socket]) &&
	    (sockServer = [OFUNIXStreamSocket socket]))







|






>
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- (void)UNIXStreamSocketTests
{
	void *pool = objc_autoreleasePoolPush();
	OFString *path;
	OFUNIXStreamSocket *sockClient, *sockServer, *sockAccepted;
	char buffer[5];

#if defined(OF_HAVE_FILES) && !defined(OF_IOS)
	path = [[OFSystemInfo temporaryDirectoryPath]
	    stringByAppendingPathComponent: [[OFUUID UUID] UUIDString]];
#else
	/*
	 * We can have sockets, including UNIX sockets, while file support is
	 * disabled.
	 *
	 * We also use this code path for iOS, as the temporaryDirectoryPath is
	 * too long on the iOS simulator.
	 */
	path = [OFString stringWithFormat: @"/tmp/%@",
					   [[OFUUID UUID] UUIDString]];
#endif

	TEST(@"+[socket]", (sockClient = [OFUNIXStreamSocket socket]) &&
	    (sockServer = [OFUNIXStreamSocket socket]))