ObjFW  Check-in [7ecfb859b9]

Overview
Comment:Add tests for Base64.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7ecfb859b997b2115607fd95d8b581083f12fb537ec86abc7e3f10b35cfc3177
User & Date: js on 2011-02-05 17:27:05
Other Links: manifest | tags
Context
2011-02-06
15:11
Add missing include. check-in: 578e7598a8 user: js tags: trunk
2011-02-05
17:27
Add tests for Base64. check-in: 7ecfb859b9 user: js tags: trunk
16:48
Add support for Base64 decoding. check-in: 43cadc9699 user: js tags: trunk
Changes

Modified PLATFORMS from [c02742fa3b] to [ee48ec9455].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ObjFW is known to work on the following platforms, but should run on
many others as well:

 +--------------------------+--------------+----------------------+---------+
 | OS                       | Architecture | Compiler             | Runtime |
 +--------------------------+--------------+----------------------+---------+
 | FreeBSD 8.0              | x86          |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | Linux 2.6.*              | x86          | GCC 4.4.1            | old GNU |
 | Linux 2.6.*              | x86          | GCC 4.6              | GNU     |
 | Linux 2.6.*              | x86          | LLVM/Clang r83252    | old GNU |
 | Linux 2.6.*              | x86_64       | GCC 4.4.1            | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | iPhone OS 2.2.1 - 4.1    | arm          | GCC 4.2              | Apple   |
 | Mac OS X 10.5            | ppc          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5            | ppc64        | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.6     | x86          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.6     | x86_64       | GCC 4.0 + 4.2        | Apple   |
 +--------------------------+--------------+----------------------+---------+
 | MirBSD 10uAB - 10uAD     | x86          | GCC 4.4.2            | old GNU |
 | MirBSD 10uAD             | x86          | LLVM/Clang r90573    | old GNU |













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ObjFW is known to work on the following platforms, but should run on
many others as well:

 +--------------------------+--------------+----------------------+---------+
 | OS                       | Architecture | Compiler             | Runtime |
 +--------------------------+--------------+----------------------+---------+
 | FreeBSD 8.0              | x86          |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | Linux 2.6.*              | x86          | GCC 4.4.1            | old GNU |
 | Linux 2.6.*              | x86          | GCC 4.6              | GNU     |
 | Linux 2.6.*              | x86          | LLVM/Clang r83252    | old GNU |
 | Linux 2.6.*              | x86_64       | GCC 4.4.1            | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | iPhone OS 2.2.1 - 4.2    | arm          | GCC 4.2              | Apple   |
 | Mac OS X 10.5            | ppc          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5            | ppc64        | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.6     | x86          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.6     | x86_64       | GCC 4.0 + 4.2        | Apple   |
 +--------------------------+--------------+----------------------+---------+
 | MirBSD 10uAB - 10uAD     | x86          | GCC 4.4.2            | old GNU |
 | MirBSD 10uAD             | x86          | LLVM/Clang r90573    | old GNU |

Modified tests/OFDataArrayTests.m from [9acf5c037e] to [5fbbe2e2ba].

97
98
99
100
101
102
103







104
105
106
107
108
109
110
		       fromCArray: "bc"
			  atIndex: 1]) && [array[0] count] == 5 &&
	    !memcmp([array[0] cArray], "abcde", 5))

	TEST(@"-[MD5Hash]", [[array[0] MD5Hash] isEqual: [@"abcde" MD5Hash]])

	TEST(@"-[SHA1Hash]", [[array[0] SHA1Hash] isEqual: [@"abcde" SHA1Hash]])








	TEST(@"Building strings",
	    (array[0] = [class dataArrayWithItemSize: 1]) &&
	    R([array[0] addNItems: 6
		       fromCArray: (void*)str]) && R([array[0] addItem: ""]) &&
	    !strcmp([array[0] cArray], str))








>
>
>
>
>
>
>







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
		       fromCArray: "bc"
			  atIndex: 1]) && [array[0] count] == 5 &&
	    !memcmp([array[0] cArray], "abcde", 5))

	TEST(@"-[MD5Hash]", [[array[0] MD5Hash] isEqual: [@"abcde" MD5Hash]])

	TEST(@"-[SHA1Hash]", [[array[0] SHA1Hash] isEqual: [@"abcde" SHA1Hash]])

	TEST(@"-[stringByBase64Encoding]",
	    [[array[0] stringByBase64Encoding] isEqual: @"YWJjZGU="])

	TEST(@"+[dataArrayWithBase64EncodedString:]",
	    !memcmp([[class dataArrayWithBase64EncodedString: @"YWJjZGU="]
	    cArray], "abcde", 5))

	TEST(@"Building strings",
	    (array[0] = [class dataArrayWithItemSize: 1]) &&
	    R([array[0] addNItems: 6
		       fromCArray: (void*)str]) && R([array[0] addItem: ""]) &&
	    !strcmp([array[0] cArray], str))