17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#import "OFTCPSocket.h"
#import "OFAutoreleasePool.h"
#import "OFString.h"
#import "OFExceptions.h"
#import "macros.h"
#import "main.h"
static OFString *module = @"OFTCPSocket";
void
tcpsocket_tests()
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
OFTCPSocket *server, *client = nil, *accepted;
OFString *service, *msg;
uint16_t port;
char buf[6];
|
|
>
|
<
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#import "OFTCPSocket.h"
#import "OFAutoreleasePool.h"
#import "OFString.h"
#import "OFExceptions.h"
#import "macros.h"
#import "TestsAppDelegate.h"
static OFString *module = @"OFTCPSocket";
@implementation TestsAppDelegate (OFTCPSocketTests)
- (void)TCPSocketTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
OFTCPSocket *server, *client = nil, *accepted;
OFString *service, *msg;
uint16_t port;
char buf[6];
|
61
62
63
64
65
66
67
|
TEST(@"-[readNBytes:intoBuffer:]", [accepted readNBytes: 6
intoBuffer: buf] &&
!memcmp(buf, "Hello!", 6))
[pool drain];
}
|
>
|
61
62
63
64
65
66
67
68
|
TEST(@"-[readNBytes:intoBuffer:]", [accepted readNBytes: 6
intoBuffer: buf] &&
!memcmp(buf, "Hello!", 6))
[pool drain];
}
@end
|