Overview
Comment: | Migration of OFTCPSocket tests to new testing framework. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
67cf530ed3a9040cceb1891a68b9ee62 |
User & Date: | js on 2009-09-30 13:23:33 |
Other Links: | manifest | tags |
Context
2009-09-30
| ||
13:33 | Migration of OFXMLElement tests to new testing framework. check-in: 2437d2d0be user: js tags: trunk | |
13:23 | Migration of OFTCPSocket tests to new testing framework. check-in: 67cf530ed3 user: js tags: trunk | |
2009-09-28
| ||
07:55 | Migration of OFList tests to new testing framework. check-in: 1d802bf56c user: js tags: trunk | |
Changes
Modified configure.ac from [4862f25471] to [2fd83093d6].
︙ | ︙ | |||
110 111 112 113 114 115 116 | struct addrinfo ai; getaddrinfo(NULL, NULL, NULL, NULL); ], [have_getaddrinfo="yes"], [have_getaddrinfo="no"]) AC_MSG_RESULT($have_getaddrinfo) test x"$have_getaddrinfo" = x"yes" && \ AC_DEFINE(HAVE_GETADDRINFO, 1, [Whether we have getaddrinfo]) | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | struct addrinfo ai; getaddrinfo(NULL, NULL, NULL, NULL); ], [have_getaddrinfo="yes"], [have_getaddrinfo="no"]) AC_MSG_RESULT($have_getaddrinfo) test x"$have_getaddrinfo" = x"yes" && \ AC_DEFINE(HAVE_GETADDRINFO, 1, [Whether we have getaddrinfo]) AC_CHECK_FUNC(madvise, [AC_DEFINE(HAVE_MADVISE, 1, [Whether we have madvise])]) AC_LANG([Objective C]) AC_PROG_OBJC OBJCFLAGS="$OBJCFLAGS -Wall -fobjc-exceptions" OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString" |
︙ | ︙ |
Modified tests/Makefile from [65d045983b] to [843c47a19e].
1 2 3 4 5 | include ../extra.mk SUBDIRS = OFDataArray \ OFHashes \ ${OFPLUGIN} \ | < | 1 2 3 4 5 6 7 8 9 10 11 | include ../extra.mk SUBDIRS = OFDataArray \ OFHashes \ ${OFPLUGIN} \ OFThread \ OFXMLElement \ OFXMLParser \ ${OBJC_SYNC} include ../buildsys.mk |
Deleted tests/OFTCPSocket/Makefile version [8dec58ac75].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/OFTCPSocket/OFTCPSocket.m version [c7b8be1093].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified tests_new/Makefile from [4ac30c970c] to [0c23107fa9].
1 2 3 4 5 6 | PROG_NOINST = tests${PROG_SUFFIX} SRCS = array.m \ dictionary.m \ list.m \ main.m \ object.m \ | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | PROG_NOINST = tests${PROG_SUFFIX} SRCS = array.m \ dictionary.m \ list.m \ main.m \ object.m \ string.m \ tcpsocket.m include ../buildsys.mk include ../extra.mk CPPFLAGS += -I../src -I.. -DSTDOUT LIBS := -L../src -lobjfw ${LIBS} |
︙ | ︙ |
Modified tests_new/main.m from [6c72294cec] to [144512e59e].
︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #import "OFAutoreleasePool.h" extern void array_tests(); extern void dictionary_tests(); extern void list_tests(); extern void object_tests(); extern void string_tests(); static int fails = 0; static void output(OFString *str, int color) { #ifdef STDOUT | > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #import "OFAutoreleasePool.h" extern void array_tests(); extern void dictionary_tests(); extern void list_tests(); extern void object_tests(); extern void string_tests(); extern void tcpsocket_tests(); static int fails = 0; static void output(OFString *str, int color) { #ifdef STDOUT |
︙ | ︙ | |||
89 90 91 92 93 94 95 96 97 98 | main() { object_tests(); string_tests(); array_tests(); dictionary_tests(); list_tests(); return fails; } | > | 90 91 92 93 94 95 96 97 98 99 100 | main() { object_tests(); string_tests(); array_tests(); dictionary_tests(); list_tests(); tcpsocket_tests(); return fails; } |
Added tests_new/tcpsocket.m version [aeddf14d19].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #include "config.h" #include <stdlib.h> #include <string.h> #include <time.h> #import "OFTCPSocket.h" #import "OFAutoreleasePool.h" #import "OFString.h" #import "OFExceptions.h" #import "OFMacros.h" #import "main.h" static OFString *module = @"OFTCPSocket"; void tcpsocket_tests() { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFSocket *server, *client, *accepted; OFString *service, *msg; uint16_t port; char buf[6]; srand(time(NULL)); port = (uint16_t)rand(); if (port < 1024) port += 1024; service = [OFString stringWithFormat: @"%d", port]; TEST(@"+[socket]", (server = [OFTCPSocket socket]) && (client = [OFTCPSocket socket])) msg = [OFString stringWithFormat: @"-[bindService:onNode:withFamily:] (port %d)", port]; TEST(msg, [server bindService: service onNode: @"localhost" withFamily: AF_INET]) TEST(@"-[listen]", [server listen]) TEST(@"-[connectToService:onNode:]", [client connectToService: service onNode: @"localhost"]) TEST(@"-[accept]", (accepted = [server accept])) TEST(@"-[writeString:]", [client writeString: @"Hello!"]) TEST(@"-[readNBytes:intoBuffer:]", [accepted readNBytes: 6 intoBuffer: buf] && !memcmp(buf, "Hello!", 6)) [pool release]; } |