Differences From Artifact [814a5cca52]:
- File
tests/OFWindowsRegistryKeyTests.m
— part of check-in
[94f1f0f479]
at
2020-04-21 22:47:25
on branch trunk
— OFWindowsRegistryKey: Compatibility with Win XP
This requires a slight API change to OFWindowsRegistryKey, as the
previous API was depending on RegGetValueW(), which is not available on
Windows XP. (user: js, size: 2836) [annotate] [blame] [check-ins using] [more...]
To Artifact [5df411ba49]:
- File tests/OFWindowsRegistryKeyTests.m — part of check-in [1b82d3bf4f] at 2021-03-07 20:25:21 on branch trunk — *.m: Fold methods into one line where it fits (user: js, size: 2764) [annotate] [blame] [check-ins using] [more...]
1 | /* | < < | | 1 2 3 4 5 6 7 8 9 | /* * 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. * |
︙ | ︙ | |||
21 22 23 24 25 26 27 | static OFString *module = @"OFWindowsRegistryKey"; @implementation TestsAppDelegate (OFWindowsRegistryKeyTests) - (void)windowsRegistryKeyTests { void *pool = objc_autoreleasePoolPush(); | | < | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | static OFString *module = @"OFWindowsRegistryKey"; @implementation TestsAppDelegate (OFWindowsRegistryKeyTests) - (void)windowsRegistryKeyTests { void *pool = objc_autoreleasePoolPush(); OFData *data = [OFData dataWithItems: "abcdef" count: 6]; OFWindowsRegistryKey *softwareKey, *ObjFWKey; DWORD type; TEST(@"+[OFWindowsRegistryKey classesRootKey]", [OFWindowsRegistryKey classesRootKey]) TEST(@"+[OFWindowsRegistryKey currentConfigKey]", |
︙ | ︙ | |||
53 54 55 56 57 58 59 | openSubkeyAtPath: @"nonexistent" securityAndAccessRights: KEY_ALL_ACCESS] == nil) TEST(@"-[createSubkeyAtPath:securityAndAccessRights:]", (ObjFWKey = [softwareKey createSubkeyAtPath: @"ObjFW" securityAndAccessRights: KEY_ALL_ACCESS])) | | | < < | | < | | < | | | | | | 50 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 | 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 |