ObjFW  Diff

Differences From Artifact [fab3932383]:

To Artifact [ad2cd47828]:


58
59
60
61
62
63
64
65
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
106
107
108
109
110




111
112
113
114


115
116
117
118
119
120
121
122
58
59
60
61
62
63
64



65
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

106
107
108
109
110
111
112







-
-
-
+
+
+

-
-
+
+
-
-
+
-
-
+
-

-
+
-
-
+

-
-
+
+
-

-
+
-
-
+

-
+
-

-
+
-
-
+

-
-
+
+

-
+
-
-
+

-
-
+
+


-
-
-
-
+
+
+
+


-
-
+
+
-







	foobar = [file categoryForName: @"foobar"];
	types = [file categoryForName: @"types"];
	TEST(@"-[categoryForName:]",
	    tests != nil && foobar != nil && types != nil)

	module = @"OFINICategory";

	TEST(@"-[stringValueForKey:]",
	    [[tests stringValueForKey: @"foo"] isEqual: @"bar"] &&
	    [[foobar stringValueForKey: @"quxquxqux"] isEqual: @"hello\"wörld"])
	TEST(@"-[stringForKey:]",
	    [[tests stringForKey: @"foo"] isEqual: @"bar"] &&
	    [[foobar stringForKey: @"quxquxqux"] isEqual: @"hello\"wörld"])

	TEST(@"-[setStringValue:forKey:]",
	    R([tests setStringValue: @"baz"
	TEST(@"-[setString:forKey:]",
	    R([tests setString: @"baz" forKey: @"foo"]) &&
			     forKey: @"foo"]) &&
	    R([tests setStringValue: @"new"
	    R([tests setString: @"new" forKey: @"new"]) &&
			     forKey: @"new"]) &&
	    R([foobar setStringValue: @"a\fb"
	    R([foobar setString: @"a\fb" forKey: @"qux3"]))
			      forKey: @"qux3"]))

	TEST(@"-[longLongValueForKey:defaultValue:]",
	TEST(@"-[longLongForKey:defaultValue:]",
	    [types longLongValueForKey: @"integer"
			  defaultValue: 2] == 0x20)
	    [types longLongForKey: @"integer" defaultValue: 2] == 0x20)

	TEST(@"-[setLongLongValue:forKey:]",
	    R([types setLongLongValue: 0x10
	TEST(@"-[setLongLong:forKey:]",
	    R([types setLongLong: 0x10 forKey: @"integer"]))
			       forKey: @"integer"]))

	TEST(@"-[boolValueForKey:defaultValue:]",
	TEST(@"-[boolForKey:defaultValue:]",
	    [types boolValueForKey: @"bool"
		      defaultValue: false] == true)
	    [types boolForKey: @"bool" defaultValue: false] == true)

	TEST(@"-[setBoolValue:forKey:]", R([types setBoolValue: false
	TEST(@"-[setBool:forKey:]", R([types setBool: false forKey: @"bool"]))
							forKey: @"bool"]))

	TEST(@"-[floatValueForKey:defaultValue:]",
	TEST(@"-[floatForKey:defaultValue:]",
	    [types floatValueForKey: @"float"
		  defaultValue: 1] == 0.5f)
	    [types floatForKey: @"float" defaultValue: 1] == 0.5f)

	TEST(@"-[setFloatValue:forKey:]", R([types setFloatValue: 0.25f
							  forKey: @"float"]))
	TEST(@"-[setFloat:forKey:]", R([types setFloat: 0.25f
						forKey: @"float"]))

	TEST(@"-[doubleValueForKey:defaultValue:]",
	TEST(@"-[doubleForKey:defaultValue:]",
	    [types doubleValueForKey: @"double"
			defaultValue: 3] == 0.25)
	    [types doubleForKey: @"double" defaultValue: 3] == 0.25)

	TEST(@"-[setDoubleValue:forKey:]", R([types setDoubleValue: 0.75
							    forKey: @"double"]))
	TEST(@"-[setDouble:forKey:]", R([types setDouble: 0.75
						  forKey: @"double"]))

	array = [OFArray arrayWithObjects: @"1", @"2", nil];
	TEST(@"-[stringValuesForKey:]",
	    [[types stringValuesForKey: @"array1"] isEqual: array] &&
	    [[types stringValuesForKey: @"array2"] isEqual: array] &&
	    [[types stringValuesForKey: @"array3"] isEqual: [OFArray array]])
	TEST(@"-[stringArrayForKey:]",
	    [[types stringArrayForKey: @"array1"] isEqual: array] &&
	    [[types stringArrayForKey: @"array2"] isEqual: array] &&
	    [[types stringArrayForKey: @"array3"] isEqual: [OFArray array]])

	array = [OFArray arrayWithObjects: @"foo", @"bar", nil];
	TEST(@"-[setStringValues:forKey:]",
	    R([types setStringValues: array
	TEST(@"-[setStringArray:forKey:]",
	    R([types setStringArray: array forKey: @"array1"]))
			      forKey: @"array1"]))

	TEST(@"-[removeValueForKey:]",
	    R([foobar removeValueForKey: @"quxqux "]) &&
	    R([types removeValueForKey: @"array2"]))

	module = @"OFINIFile";