@@ -15,19 +15,18 @@ #include "config.h" #import "TestsAppDelegate.h" -static OFString *module = @"OFWindowsRegistryKey"; +static OFString *const module = @"OFWindowsRegistryKey"; @implementation TestsAppDelegate (OFWindowsRegistryKeyTests) - (void)windowsRegistryKeyTests { void *pool = objc_autoreleasePoolPush(); - OFData *data = [OFData dataWithItems: "abcdef" - count: 6]; - OFWindowsRegistryKey *softwareKey, *ObjFWKey; + OFData *data = [OFData dataWithItems: "abcdef" count: 6]; + OFWindowsRegistryKey *softwareKey, *objFWKey; DWORD type; TEST(@"+[OFWindowsRegistryKey classesRootKey]", [OFWindowsRegistryKey classesRootKey]) @@ -50,39 +49,35 @@ [[OFWindowsRegistryKey currentUserKey] openSubkeyAtPath: @"nonexistent" securityAndAccessRights: KEY_ALL_ACCESS] == nil) TEST(@"-[createSubkeyAtPath:securityAndAccessRights:]", - (ObjFWKey = [softwareKey createSubkeyAtPath: @"ObjFW" + (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] && + 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:forValue:type:]", - R([ObjFWKey setString: @"foobar" - forValue: @"string"]) && - R([ObjFWKey setString: @"%PATH%;foo" - forValue: @"expand" + 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 stringForValue: @"string"] isEqual: @"foobar"] && - [[ObjFWKey stringForValue: @"expand" - type: &type] isEqual: @"%PATH%;foo"] && + [[objFWKey stringForValueNamed: @"string"] isEqual: @"foobar"] && + [[objFWKey stringForValueNamed: @"expand" type: &type] + isEqual: @"%PATH%;foo"] && type == REG_EXPAND_SZ) - TEST(@"-[deleteValue:]", R([ObjFWKey deleteValue: @"data"])) + TEST(@"-[deleteValueNamed:]", R([objFWKey deleteValueNamed: @"data"])) TEST(@"-[deleteSubkeyAtPath:]", R([softwareKey deleteSubkeyAtPath: @"ObjFW"])) objc_autoreleasePoolPop(pool); } @end