Index: new_tests/Makefile ================================================================== --- new_tests/Makefile +++ new_tests/Makefile @@ -24,10 +24,11 @@ OFHMACTests.m \ OFINIFileTests.m \ OFIRITests.m \ OFInvocationTests.m \ OFJSONTests.m \ + OFLocaleTests.m \ OFMatrix4x4Tests.m \ OFMethodSignatureTests.m \ OFMutableArrayTests.m \ OFMutableSetTests.m \ OFNumberTests.m \ ADDED new_tests/OFLocaleTests.m Index: new_tests/OFLocaleTests.m ================================================================== --- new_tests/OFLocaleTests.m +++ new_tests/OFLocaleTests.m @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2008-2024 Jonathan Schleifer + * + * 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 "ObjFW.h" +#import "ObjFWTest.h" + +@interface OFLocaleTests: OTTestCase +@end + +@implementation OFLocaleTests ++ (OFArray OF_GENERIC(OFPair OF_GENERIC(OFString *, id) *) *)summary +{ + OFMutableArray *summary = [OFMutableArray array]; + +#define ADD(name, value) \ + [summary addObject: [OFPair pairWithFirstObject: name \ + secondObject: value]]; + + ADD(@"Language code", [OFLocale languageCode]) + ADD(@"Country code", [OFLocale countryCode]) + ADD(@"Encoding", OFStringEncodingName([OFLocale encoding])) + ADD(@"Decimal separator", [OFLocale decimalSeparator]) + +#undef ADD + + return summary; +} +@end Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -16,11 +16,10 @@ SRCS = ForwardingTests.m \ ${OF_BLOCK_TESTS_M} \ OFDataTests.m \ OFDictionaryTests.m \ OFListTests.m \ - OFLocaleTests.m \ OFMemoryStreamTests.m \ OFNotificationCenterTests.m \ OFObjectTests.m \ OFStreamTests.m \ OFStringTests.m \ DELETED tests/OFLocaleTests.m Index: tests/OFLocaleTests.m ================================================================== --- tests/OFLocaleTests.m +++ tests/OFLocaleTests.m @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2008-2024 Jonathan Schleifer - * - * 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 "TestsAppDelegate.h" - -@implementation TestsAppDelegate (OFLocaleTests) -- (void)localeTests -{ - void *pool = objc_autoreleasePoolPush(); - - [OFStdOut setForegroundColor: [OFColor lime]]; - - [OFStdOut writeFormat: @"[OFLocale] Language code: %@\n", - [OFLocale languageCode]]; - - [OFStdOut writeFormat: @"[OFLocale] Country code: %@\n", - [OFLocale countryCode]]; - - [OFStdOut writeFormat: @"[OFLocale] Encoding: %@\n", - OFStringEncodingName([OFLocale encoding])]; - - [OFStdOut writeFormat: @"[OFLocale] Decimal separator: %@\n", - [OFLocale decimalSeparator]]; - - objc_autoreleasePoolPop(pool); -} -@end Index: tests/TestsAppDelegate.h ================================================================== --- tests/TestsAppDelegate.h +++ tests/TestsAppDelegate.h @@ -101,14 +101,10 @@ @interface TestsAppDelegate (OFListTests) - (void)listTests; @end -@interface TestsAppDelegate (OFLocaleTests) -- (void)localeTests; -@end - @interface TestsAppDelegate (OFMemoryStreamTests) - (void)memoryStreamTests; @end @interface TestsAppDelegate (OFNotificationCenterTests) Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -417,12 +417,10 @@ #ifdef OF_WINDOWS [self windowsRegistryKeyTests]; #endif - [self localeTests]; - [OFStdOut reset]; #if defined(OF_IOS) [OFStdOut writeFormat: @"%d tests failed!", _fails]; [OFApplication terminateWithStatus: _fails];