ObjFW  Check-in [7075962f87]

Overview
Comment:Print system info at the end of the tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7075962f8768cc3a888f63b2bb91f5b455a9bd368c067de7aab2c600e13c04d2
User & Date: js on 2018-04-15 15:09:53
Other Links: manifest | tags
Context
2018-04-15
17:41
OFLocalization: Add support for AmigaOS 4 check-in: eca1f56e3d user: js tags: trunk
15:09
Print system info at the end of the tests check-in: 7075962f87 user: js tags: trunk
14:49
OFLocalization: Fix setting the territory check-in: 4dfd47aeaa user: js tags: trunk
Changes

Modified tests/Makefile from [4850c1be9d] to [2341a79b0d].

25
26
27
28
29
30
31

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







+







       OFMethodSignatureTests.m		\
       OFNumberTests.m			\
       OFObjectTests.m			\
       OFPropertyListTests.m		\
       OFSetTests.m			\
       OFStreamTests.m			\
       OFStringTests.m			\
       OFSystemInfoTests.m		\
       OFURLTests.m			\
       OFValueTests.m			\
       OFXMLElementBuilderTests.m	\
       OFXMLNodeTests.m			\
       OFXMLParserTests.m		\
       PBKDF2Tests.m			\
       RuntimeTests.m			\

Modified tests/OFLocalizationTests.m from [5929d44b99] to [1b1cfd39d3].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
31
32

33
34
35
36
37

38
39
40
41
42
43


44
45
46
47
48
49

50
51
52
53
54
55
17
18
19
20
21
22
23
24
25
26
27
28
29
30

31


32


33


34


35



36
37


38



39


40
41
42
43







+
+





-

-
-
+
-
-

-
-
+
-
-

-
-
-
+
+
-
-

-
-
-
+
-
-





#include "config.h"

#import "OFLocalization.h"
#import "OFAutoreleasePool.h"

#import "TestsAppDelegate.h"

static OFString *module = @"OFLocalization";

@implementation TestsAppDelegate (OFLocalizationTests)
- (void)localizationTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFString *msg;

	msg = [OFString stringWithFormat:
	     @"[OFLocalization] Language: %@\n", [OFLocalization language]];
	PRINT(GREEN, @"Language: %@", [OFLocalization language]);
	[self outputString: msg
		   inColor: GREEN];

	msg = [OFString stringWithFormat:
	    @"[OFLocalization] Territory: %@\n", [OFLocalization territory]];
	PRINT(GREEN, @"Territory: %@", [OFLocalization territory]);
	[self outputString: msg
		   inColor: GREEN];

	msg = [OFString stringWithFormat:
	    @"[OFLocalization] Encoding: %@\n",
	    of_string_name_of_encoding([OFLocalization encoding])];
	PRINT(GREEN, @"Encoding: %@",
	    of_string_name_of_encoding([OFLocalization encoding]));
	[self outputString: msg
		   inColor: GREEN];

	msg = [OFString stringWithFormat:
	    @"[OFLocalization] Decimal point: %@\n",
	    [OFLocalization decimalPoint]];
	PRINT(GREEN, @"Decimal point: %@", [OFLocalization decimalPoint]);
	[self outputString: msg
		   inColor: GREEN];

	[pool drain];
}
@end

Added tests/OFSystemInfoTests.m version [d3ce6a43df].













































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
 *               2018
 *   Jonathan Schleifer <js@heap.zone>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#import "OFSystemInfo.h"
#import "OFAutoreleasePool.h"

#import "TestsAppDelegate.h"

static OFString *module = @"OFSystemInfo";

@implementation TestsAppDelegate (OFSystemInfoTests)
- (void)systemInfoTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

	PRINT(GREEN, @"Page size: %zd", [OFSystemInfo pageSize]);

	PRINT(GREEN, @"Number of CPUs: %zd", [OFSystemInfo numberOfCPUs]);

	PRINT(GREEN, @"Operating system name: %@",
	    [OFSystemInfo operatingSystemName]);

	PRINT(GREEN, @"Operating system version: %@",
	    [OFSystemInfo operatingSystemVersion]);

#ifdef OF_HAVE_FILES
	PRINT(GREEN, @"User data path: %@", [OFSystemInfo userDataPath]);

	PRINT(GREEN, @"User config path: %@", [OFSystemInfo userDataPath]);
#endif

	PRINT(GREEN, @"CPU vendor: %@", [OFSystemInfo CPUVendor]);

#if defined(OF_X86_64) || defined(OF_X86)
	PRINT(GREEN, @"Supports MMX: %d", [OFSystemInfo supportsMMX]);

	PRINT(GREEN, @"Supports SSE: %d", [OFSystemInfo supportsSSE]);

	PRINT(GREEN, @"Supports SSE2: %d", [OFSystemInfo supportsSSE2]);

	PRINT(GREEN, @"Supports SSE3: %d", [OFSystemInfo supportsSSE3]);

	PRINT(GREEN, @"Supports SSSE3: %d", [OFSystemInfo supportsSSSE3]);

	PRINT(GREEN, @"Supports SSE4.1: %d", [OFSystemInfo supportsSSE41]);

	PRINT(GREEN, @"Supports SSE4.2: %d", [OFSystemInfo supportsSSE42]);

	PRINT(GREEN, @"Supports AVX: %d", [OFSystemInfo supportsAVX]);

	PRINT(GREEN, @"Supports AVX2: %d", [OFSystemInfo supportsAVX2]);
#endif

#ifdef OF_POWERPC
	PRINT(GREEN, @"Supports AltiVec: %d", [OFSystemInfo supportsAltiVec]);
#endif

	[pool drain];
}
@end

Modified tests/TestsAppDelegate.h from [cf65eeb924] to [ddf3fa4731].

51
52
53
54
55
56
57







58
59
60
61
62
63
64
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71







+
+
+
+
+
+
+







		else {					\
			[self outputFailure: test	\
				   inModule: module];	\
			_fails++;			\
		}					\
	}
#define R(...) (__VA_ARGS__, 1)
#define PRINT(color, fmt, ...)					\
	{							\
		OFString *msg = [OFString stringWithFormat:	\
		    @"[%@] " fmt @"\n", module, __VA_ARGS__];	\
		[self outputString: msg				\
			   inColor: color];			\
	}

@class OFString;

enum {
	NO_COLOR,
	RED,
	GREEN,
203
204
205
206
207
208
209




210
211
212
213
214
215
216
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227







+
+
+
+







@interface TestsAppDelegate (OFSHA384HashTests)
- (void)SHA384HashTests;
@end

@interface TestsAppDelegate (OFSHA512HashTests)
- (void)SHA512HashTests;
@end

@interface TestsAppDelegate (OFSystemInfoTests)
- (void)systemInfoTests;
@end

@interface TestsAppDelegate (OFHMACTests)
- (void)HMACTests;
@end

@interface TestsAppDelegate (OFStreamTests)
- (void)streamTests;

Modified tests/TestsAppDelegate.m from [a068037952] to [251eb0b81a].

431
432
433
434
435
436
437

438
439
440
441
442
443
444
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445







+







#endif
	[self JSONTests];
	[self propertyListTests];
#if defined(OF_HAVE_PLUGINS)
	[self pluginTests];
#endif

	[self systemInfoTests];
	[self localizationTests];

#if defined(OF_IOS)
	[self outputString: [OFString stringWithFormat: @"%d tests failed!",
							_fails]
		   inColor: NO_COLOR];
	[OFApplication terminateWithStatus: _fails];