ObjFW  Check-in [7cc77e2a1b]

Overview
Comment:%zd -> %zu.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7cc77e2a1b36c47142016705dc859e02dd922532ea03287b4014cfbaa760a726
User & Date: js on 2008-09-14 19:38:14
Other Links: manifest | tags
Context
2008-09-14
19:41
Also test for exceptions from OFObject's resizeMem:. check-in: dc4f1a26d6 user: js tags: trunk
19:38
%zd -> %zu. check-in: 7cc77e2a1b user: js tags: trunk
19:35
More exception testing stuff for OFObject. check-in: 8b2f3fab96 user: js tags: trunk
Changes

Modified src/OFExceptions.m from [7125d2d9c0] to [637d243e7f].

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	return [[OFNoMemException alloc] init: obj
				     withSize: size];
}

-     init: (id)obj
  withSize: (size_t)size
{
	fprintf(stderr, "ERROR: Could not allocate %zd byte for object %s!\n",
	    size, [obj name]);

	return [super init];
}
@end

@implementation OFMemNotPartOfObjException







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	return [[OFNoMemException alloc] init: obj
				     withSize: size];
}

-     init: (id)obj
  withSize: (size_t)size
{
	fprintf(stderr, "ERROR: Could not allocate %zu byte for object %s!\n",
	    size, [obj name]);

	return [super init];
}
@end

@implementation OFMemNotPartOfObjException

Modified tests/OFList/OFList.m from [106c4c0f9c] to [bc3bf85f04].

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
	[list addNew: [OFString new: strings[0]]];
	[list addNew: [OFString new: strings[1]]];
	[list addNew: [OFString new: strings[2]]];
 
	for (iter = [list first], i = 0; iter != nil; iter = [iter next], i++)
		if (!strcmp([(OFString*)[iter data] cString], strings[i]))
			printf("Element %zd is expected element. GOOD!\n", i);
		else {
			printf("Element %zd is not expected element!\n", i);
			return 1;
		}

	if (!strcmp([(OFString*)[[list first] data] cString], strings[0]))
		puts("First element is expected element. GOOD!");
	else {
		puts("First element is not expected element!");







|

|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
	[list addNew: [OFString new: strings[0]]];
	[list addNew: [OFString new: strings[1]]];
	[list addNew: [OFString new: strings[2]]];
 
	for (iter = [list first], i = 0; iter != nil; iter = [iter next], i++)
		if (!strcmp([(OFString*)[iter data] cString], strings[i]))
			printf("Element %zu is expected element. GOOD!\n", i);
		else {
			printf("Element %zu is not expected element!\n", i);
			return 1;
		}

	if (!strcmp([(OFString*)[[list first] data] cString], strings[0]))
		puts("First element is expected element. GOOD!");
	else {
		puts("First element is not expected element!");