Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add OFDNSResolverTests These only print the settings for now. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
35347686ad082fa08c09c2fdd8023752 |
| User & Date: | js 2018-08-19 23:32:44.000 |
Context
|
2018-08-19
| ||
| 23:50 | OFDNSResolver: Do not allow IPs as local domain check-in: 7050b3a480 user: js tags: trunk | |
| 23:32 | Add OFDNSResolverTests check-in: 35347686ad user: js tags: trunk | |
| 02:40 | tests: Ignore unimplemented user{Config,Data}Path check-in: e814441c17 user: js tags: trunk | |
Changes
Changes to tests/Makefile.
| ︙ | ︙ | |||
48 49 50 51 52 53 54 | OFSerializationTests.m \ OFSHA1HashTests.m \ OFSHA224HashTests.m \ OFSHA256HashTests.m \ OFSHA384HashTests.m \ OFSHA512HashTests.m SRCS_PLUGINS = OFPluginTests.m | > | | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
OFSerializationTests.m \
OFSHA1HashTests.m \
OFSHA224HashTests.m \
OFSHA256HashTests.m \
OFSHA384HashTests.m \
OFSHA512HashTests.m
SRCS_PLUGINS = OFPluginTests.m
SRCS_SOCKETS = OFDNSResolverTests.m \
OFHTTPCookieTests.m \
OFHTTPCookieManagerTests.m \
${OFHTTPCLIENTTESTS_M} \
OFKernelEventObserverTests.m \
OFTCPSocketTests.m \
OFUDPSocketTests.m \
SocketTests.m
SRCS_THREADS = OFThreadTests.m
|
| ︙ | ︙ |
Added tests/OFDNSResolverTests.m.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 |
/*
* 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 "OFDNSResolver.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"
#import "TestsAppDelegate.h"
static OFString *module = @"OFDNSResolverTests";
@implementation TestsAppDelegate (OFDNSResolverTests)
- (void)DNSResolverTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
OFDNSResolver *resolver = [OFDNSResolver resolver];
OFMutableString *staticHosts = [OFMutableString string];
for (OFString *host in [resolver staticHosts]) {
OFString *IPs;
if ([staticHosts length] > 0)
[staticHosts appendString: @"; "];
IPs = [[[resolver staticHosts] objectForKey: host]
componentsJoinedByString: @", "];
[staticHosts appendFormat: @"%@=(%@)", host, IPs];
}
PRINT(GREEN, @"Static hosts: %@", staticHosts);
PRINT(GREEN, @"Name servers: %@",
[[resolver nameServers] componentsJoinedByString: @", "]);
PRINT(GREEN, @"Local domain: %@", [resolver localDomain]);
PRINT(GREEN, @"Search domains: %@",
[[resolver searchDomains] componentsJoinedByString: @", "]);
PRINT(GREEN, @"Timeout: %lf", [resolver timeout]);
PRINT(GREEN, @"Max attempts: %u", [resolver maxAttempts]);
PRINT(GREEN, @"Min number of dots in absolute name: %u",
[resolver minNumberOfDotsInAbsoluteName]);
PRINT(GREEN, @"Uses TCP: %u", [resolver usesTCP]);
PRINT(GREEN, @"Config reload interval: %lf",
[resolver configReloadInterval]);
[pool drain];
}
@end
|
Changes to tests/TestsAppDelegate.h.
| ︙ | ︙ | |||
94 95 96 97 98 99 100 101 102 103 104 105 106 107 | @interface TestsAppDelegate (OFBlockTests) - (void)blockTests; @end @interface TestsAppDelegate (OFCharacterSetTests) - (void)characterSetTests; @end @interface TestsAppDelegate (OFDataTests) - (void)dataTests; @end @interface TestsAppDelegate (OFDateTests) - (void)dateTests; | > > > > | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | @interface TestsAppDelegate (OFBlockTests) - (void)blockTests; @end @interface TestsAppDelegate (OFCharacterSetTests) - (void)characterSetTests; @end @interface TestsAppDelegate (OFDNSResolverTests) - (void)DNSResolverTests; @end @interface TestsAppDelegate (OFDataTests) - (void)dataTests; @end @interface TestsAppDelegate (OFDateTests) - (void)dateTests; |
| ︙ | ︙ |
Changes to tests/TestsAppDelegate.m.
| ︙ | ︙ | |||
438 439 440 441 442 443 444 445 446 447 448 449 450 451 | #endif [self JSONTests]; [self propertyListTests]; #if defined(OF_HAVE_PLUGINS) [self pluginTests]; #endif [self systemInfoTests]; [self localeTests]; #if defined(OF_IOS) [self outputString: [OFString stringWithFormat: @"%d tests failed!", _fails] inColor: NO_COLOR]; | > > > | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | #endif [self JSONTests]; [self propertyListTests]; #if defined(OF_HAVE_PLUGINS) [self pluginTests]; #endif #ifdef OF_HAVE_SOCKETS [self DNSResolverTests]; #endif [self systemInfoTests]; [self localeTests]; #if defined(OF_IOS) [self outputString: [OFString stringWithFormat: @"%d tests failed!", _fails] inColor: NO_COLOR]; |
| ︙ | ︙ |