ObjFW  Diff

Differences From Artifact [6cb38442bb]:

  • File tests/OFDictionaryTests.m — part of check-in [cfd54bd090] at 2017-05-01 13:51:41 on branch trunk — Add tests for generic OF(Mutable)Dictionary

    These are usually not used, as OFDictionary_hashtable and
    OFMutableDictionary_hashtable are used instead. However, they are used
    if someone creates their own subclass of OFDictionary /
    OFMutableDictionary. As they are rarely used in production, it is
    important to run all tests on them. (user: js, size: 9537) [annotate] [blame] [check-ins using]

To Artifact [b05d0d80fb]:


77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
		[self release];
		@throw e;
	}

	return self;
}

- initWithObjects: (const id*)objects
	  forKeys: (const id*)keys
	    count: (size_t)count
{
	self = [super init];

	@try {
		_dictionary = [[OFMutableDictionary alloc]
		    initWithObjects: objects







|
|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
		[self release];
		@throw e;
	}

	return self;
}

- initWithObjects: (const id *)objects
	  forKeys: (const id *)keys
	    count: (size_t)count
{
	self = [super init];

	@try {
		_dictionary = [[OFMutableDictionary alloc]
		    initWithObjects: objects
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
}

- (size_t)count
{
	return [_dictionary count];
}

- (OFEnumerator*)keyEnumerator
{
	return [_dictionary keyEnumerator];
}

- (OFEnumerator*)objectEnumerator
{
	return [_dictionary objectEnumerator];
}

- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (id*)objects
			     count: (int)count
{
	return [_dictionary countByEnumeratingWithState: state
						objects: objects
						  count: count];
}
@end







|




|




|
|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
}

- (size_t)count
{
	return [_dictionary count];
}

- (OFEnumerator *)keyEnumerator
{
	return [_dictionary keyEnumerator];
}

- (OFEnumerator *)objectEnumerator
{
	return [_dictionary objectEnumerator];
}

- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t *)state
			   objects: (id *)objects
			     count: (int)count
{
	return [_dictionary countByEnumeratingWithState: state
						objects: objects
						  count: count];
}
@end