ObjFW  Diff

Differences From Artifact [7fc519cbf2]:

To Artifact [15af30b63f]:


1
2
3
4

5
6
7
8
9
10
11
1



2
3
4
5
6
7
8
9

-
-
-
+







/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
 *               2018, 2019, 2020
 *   Jonathan Schleifer <js@nil.im>
 * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
108
109
110
111
112
113
114
115

116
117

118
119
120
121
122
123

124
125
126
127
128
129
130
131
106
107
108
109
110
111
112

113


114

115
116
117
118

119

120
121
122
123
124
125
126







-
+
-
-
+
-




-
+
-







	    [[m valueForKey: @"classValue"] isEqual: m.class] &&
	    [[m valueForKey: @"class"] isEqual: m.class])

	EXPECT_EXCEPTION(@"-[valueForKey:] with undefined key",
	    OFUndefinedKeyException, [m valueForKey: @"undefined"])

	TEST(@"-[setValue:forKey:]",
	    R([m setValue: @"World"
	    R([m setValue: @"World" forKey: @"objectValue"]) &&
		   forKey: @"objectValue"]) &&
	    R([m setValue: [OFObject class]
	    R([m setValue: [OFObject class] forKey: @"classValue"]) &&
		   forKey: @"classValue"]) &&
	    [m.objectValue isEqual: @"World"] &&
	    [m.classValue isEqual: [OFObject class]])

	EXPECT_EXCEPTION(@"-[setValue:forKey:] with undefined key",
	    OFUndefinedKeyException, [m setValue: @"x"
	    OFUndefinedKeyException, [m setValue: @"x" forKey: @"undefined"])
					  forKey: @"undefined"])

	m.boolValue = 1;
	m.charValue = 2;
	m.shortValue = 3;
	m.intValue = 4;
	m.longValue = 5;
	m.longLongValue = 6;