Overview
Comment: | Migrate OFCharacterSetTests to ObjFWTest |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | objfwtest |
Files: | files | file ages | folders |
SHA3-256: |
4127a58b043925f01fc94c6389c6fc5d |
User & Date: | js on 2024-02-11 14:26:07 |
Other Links: | branch diff | manifest | tags |
Context
2024-02-11
| ||
15:00 | Merge trunk into branch "objfwtest" check-in: 96f556e1fd user: js tags: objfwtest | |
14:26 | Migrate OFCharacterSetTests to ObjFWTest check-in: 4127a58b04 user: js tags: objfwtest | |
14:13 | Migrate OFScryptTests to ObjFWTest check-in: 86a2f1e2bf user: js tags: objfwtest | |
Changes
Modified new_tests/Makefile from [a58e6edb61] to [3a5f214920].
1 2 3 4 5 | include ../extra.mk SUBDIRS = ${TESTPLUGIN} PROG_NOINST = tests${PROG_SUFFIX} | > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | include ../extra.mk SUBDIRS = ${TESTPLUGIN} PROG_NOINST = tests${PROG_SUFFIX} SRCS = OFCharacterSetTests.m \ OFColorTests.m \ OFIRITests.m \ OFNumberTests.m \ OFPBKDF2Tests.m \ OFPropertyListTests.m \ OFScryptTests.m \ ${USE_SRCS_PLUGINS} SRCS_PLUGINS = OFPluginTests.m |
︙ | ︙ |
Renamed and modified tests/OFCharacterSetTests.m [cbaf41131b] to new_tests/OFCharacterSetTests.m [2ac90291b5].
︙ | ︙ | |||
11 12 13 14 15 16 17 | * 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" | | > | > | | | | < | < < < < | < | | | | | < < | | | | | > | < | | | < | > > | > > > > | < | < < < < < | < | | | | | < | > | | > | | | | | | < | > | < | > < > | 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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | * 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" #import "OFCharacterSet.h" #import "OFBitSetCharacterSet.h" #import "OFRangeCharacterSet.h" @interface OFCharacterSetTests: OTTestCase @end @interface CustomCharacterSet: OFCharacterSet @end @implementation CustomCharacterSet - (bool)characterIsMember: (OFUnichar)character { return (character % 2 == 0); } @end @implementation OFCharacterSetTests - (void)testCustomCharacterSet { OFCharacterSet *characterSet = [[[CustomCharacterSet alloc] init] autorelease]; for (OFUnichar c = 0; c < 65536; c++) if (c % 2 == 0) OTAssertTrue([characterSet characterIsMember: c]); else OTAssertFalse([characterSet characterIsMember: c]); } - (void)testBitSetCharacterSet { OFCharacterSet *characterSet = [OFCharacterSet characterSetWithCharactersInString: @"0123456789"]; OTAssertTrue( [characterSet isKindOfClass: [OFBitSetCharacterSet class]]); for (OFUnichar c = 0; c < 65536; c++) if (c >= '0' && c <= '9') OTAssertTrue([characterSet characterIsMember: c]); else if ([characterSet characterIsMember: c]) OTAssertFalse([characterSet characterIsMember: c]); } - (void)testRangeCharacterSet { OFCharacterSet *characterSet = [OFCharacterSet characterSetWithRange: OFMakeRange('0', 10)]; OTAssertTrue( [characterSet isKindOfClass: [OFRangeCharacterSet class]]); for (OFUnichar c = 0; c < 65536; c++) if (c >= '0' && c <= '9') OTAssertTrue([characterSet characterIsMember: c]); else OTAssertFalse([characterSet characterIsMember: c]); } - (void)testInvertedCharacterSet { OFCharacterSet *characterSet = [[OFCharacterSet characterSetWithRange: OFMakeRange('0', 10)] invertedSet]; for (OFUnichar c = 0; c < 65536; c++) if (c >= '0' && c <= '9') OTAssertFalse([characterSet characterIsMember: c]); else OTAssertTrue([characterSet characterIsMember: c]); } - (void)testInvertingInvertedSetReturnsOriginal { OFCharacterSet *characterSet = [OFCharacterSet characterSetWithRange: OFMakeRange('0', 10)]; OTAssertEqual(characterSet, characterSet.invertedSet.invertedSet); } @end |
Modified tests/Makefile from [58ce3dc37f] to [f68868d684].
︙ | ︙ | |||
15 16 17 18 19 20 21 | DISTCLEAN = Info.plist PROG_NOINST = tests${PROG_SUFFIX} STATIC_LIB_NOINST = ${TESTS_STATIC_LIB} SRCS = ForwardingTests.m \ OFArrayTests.m \ ${OF_BLOCK_TESTS_M} \ | < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | DISTCLEAN = Info.plist PROG_NOINST = tests${PROG_SUFFIX} STATIC_LIB_NOINST = ${TESTS_STATIC_LIB} SRCS = ForwardingTests.m \ OFArrayTests.m \ ${OF_BLOCK_TESTS_M} \ OFDataTests.m \ OFDateTests.m \ OFDictionaryTests.m \ OFHMACTests.m \ OFINIFileTests.m \ OFInvocationTests.m \ OFJSONTests.m \ |
︙ | ︙ |
Modified tests/TestsAppDelegate.h from [3ea4afb148] to [146f2a2590].
︙ | ︙ | |||
63 64 65 66 67 68 69 | - (void)arrayTests; @end @interface TestsAppDelegate (OFBlockTests) - (void)blockTests; @end | < < < < | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - (void)arrayTests; @end @interface TestsAppDelegate (OFBlockTests) - (void)blockTests; @end @interface TestsAppDelegate (OFDDPSocketTests) - (void)DDPSocketTests; @end @interface TestsAppDelegate (OFDNSResolverTests) - (void)DNSResolverTests; @end |
︙ | ︙ |
Modified tests/TestsAppDelegate.m from [5e0d241d80] to [5965b1f53c].
︙ | ︙ | |||
378 379 380 381 382 383 384 | [self methodSignatureTests]; [self invocationTests]; [self forwardingTests]; #ifdef OF_HAVE_BLOCKS [self blockTests]; #endif [self stringTests]; | < | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | [self methodSignatureTests]; [self invocationTests]; [self forwardingTests]; #ifdef OF_HAVE_BLOCKS [self blockTests]; #endif [self stringTests]; [self dataTests]; [self arrayTests]; [self dictionaryTests]; [self listTests]; [self setTests]; [self dateTests]; [self valueTests]; |
︙ | ︙ |