51
52
53
54
55
56
57
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
|
openSubkeyAtPath: @"nonexistent"
securityAndAccessRights: KEY_ALL_ACCESS] == nil)
TEST(@"-[createSubkeyAtPath:securityAndAccessRights:]",
(ObjFWKey = [softwareKey createSubkeyAtPath: @"ObjFW"
securityAndAccessRights: KEY_ALL_ACCESS]))
TEST(@"-[setData:forValue:type:]",
R([ObjFWKey setData: data
forValue: @"data"
type: REG_BINARY]))
TEST(@"-[dataForValue:subkeyPath:flags:type:]",
[[ObjFWKey dataForValue: @"data"
type: &type] isEqual: data] &&
type == REG_BINARY)
TEST(@"-[setString:forValue:type:]",
R([ObjFWKey setString: @"foobar"
forValue: @"string"]) &&
R([ObjFWKey setString: @"%PATH%;foo"
forValue: @"expand"
type: REG_EXPAND_SZ]))
TEST(@"-[stringForValue:subkeyPath:]",
[[ObjFWKey stringForValue: @"string"] isEqual: @"foobar"] &&
[[ObjFWKey stringForValue: @"expand"
type: &type] isEqual: @"%PATH%;foo"] &&
type == REG_EXPAND_SZ)
TEST(@"-[deleteValue:]", R([ObjFWKey deleteValue: @"data"]))
TEST(@"-[deleteSubkeyAtPath:]",
R([softwareKey deleteSubkeyAtPath: @"ObjFW"]))
objc_autoreleasePoolPop(pool);
}
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51
52
53
54
55
56
57
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
|
openSubkeyAtPath: @"nonexistent"
securityAndAccessRights: KEY_ALL_ACCESS] == nil)
TEST(@"-[createSubkeyAtPath:securityAndAccessRights:]",
(ObjFWKey = [softwareKey createSubkeyAtPath: @"ObjFW"
securityAndAccessRights: KEY_ALL_ACCESS]))
TEST(@"-[setData:forValueNamed:type:]",
R([ObjFWKey setData: data
forValueNamed: @"data"
type: REG_BINARY]))
TEST(@"-[dataForValueNamed:subkeyPath:flags:type:]",
[[ObjFWKey dataForValueNamed: @"data"
type: &type] isEqual: data] &&
type == REG_BINARY)
TEST(@"-[setString:forValueNamed:type:]",
R([ObjFWKey setString: @"foobar"
forValueNamed: @"string"]) &&
R([ObjFWKey setString: @"%PATH%;foo"
forValueNamed: @"expand"
type: REG_EXPAND_SZ]))
TEST(@"-[stringForValue:subkeyPath:]",
[[ObjFWKey stringForValueNamed: @"string"] isEqual: @"foobar"] &&
[[ObjFWKey stringForValueNamed: @"expand"
type: &type] isEqual: @"%PATH%;foo"] &&
type == REG_EXPAND_SZ)
TEST(@"-[deleteValueNamed:]", R([ObjFWKey deleteValueNamed: @"data"]))
TEST(@"-[deleteSubkeyAtPath:]",
R([softwareKey deleteSubkeyAtPath: @"ObjFW"]))
objc_autoreleasePoolPop(pool);
}
@end
|