ObjFW  Diff

Differences From Artifact [a5da935c08]:

To Artifact [6aad159bdb]:


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
101
102
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
101
102
103
104
105







-
-
-
+
+
+
+

-
+
+

















+
-
+







	[a freeMem: q];							\
									\
	puts("Adding multiple items at once...");			\
	p = [a allocWithSize: 8192];					\
	memset(p, 64, 8192);						\
	[a addNItems: 2							\
	  fromCArray: p];						\
	if (!memcmp([a last], [a item: [a count] - 2], 4096) &&		\
	    !memcmp([a item: [a count] - 2], p, 4096))			\
		puts("[a last], [a item: [a count] - 2] and p match!");	\
	if (!memcmp([a last], [a itemAtIndex: [a count] - 2], 4096) &&	\
	    !memcmp([a itemAtIndex: [a count] - 2], p, 4096))		\
		puts("[a last], [a itemAtIndex: [a count] - 2] and p "	\
		    "match!");						\
	else {								\
		puts("[a last], [a item: [a count] - 2] and p did not match!");\
		puts("[a last], [a itemAtIndex: [a count] - 2] and p "	\
		    "do not match!");					\
		abort();						\
	}								\
	[a freeMem: p];							\
									\
	i = [a count];							\
	puts("Removing 2 items...");					\
	[a removeNItems: 2];						\
	if ([a count] + 2 != i) {					\
		puts("[a count] + 2 != i!");				\
		abort();						\
	}								\
									\
	puts("Trying to remove more data than we added...");		\
	CATCH_EXCEPTION([a removeNItems: [a count] + 1],		\
	    OFOutOfRangeException);					\
									\
	puts("Trying to access an index that does not exist...");	\
	CATCH_EXCEPTION([a itemAtIndex: [a count]],			\
	CATCH_EXCEPTION([a item: [a count]], OFOutOfRangeException);	\
	    OFOutOfRangeException);					\
									\
	[a release];							\
									\
	puts("Creating new array and using it to build a string...");	\
	a = [[type alloc] initWithItemSize: 1];				\
									\
	for (i = 0; i < strlen(str); i++)				\