Differences From 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...]
To Artifact [b3eba3a2d6]:
- File
tests/OFWindowsRegistryKeyTests.m
— part of check-in
[14f1e22d79]
at
2021-05-08 23:22:59
on branch trunk
— tests: Align more with ObjFW style
ObjFW's style changed over the years, but the tests were never adjusted
to it. (user: js, size: 2770) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
13 14 15 16 17 18 19 | * file. */ #include "config.h" #import "TestsAppDelegate.h" | | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | * file. */ #include "config.h" #import "TestsAppDelegate.h" static OFString *const 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]", [OFWindowsRegistryKey currentConfigKey]) |
︙ | ︙ | |||
47 48 49 50 51 52 53 | openSubkeyAtPath: @"Software" securityAndAccessRights: KEY_ALL_ACCESS]) && [[OFWindowsRegistryKey currentUserKey] openSubkeyAtPath: @"nonexistent" securityAndAccessRights: KEY_ALL_ACCESS] == nil) TEST(@"-[createSubkeyAtPath:securityAndAccessRights:]", | | | | | | | | | | 47 48 49 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: @"Software" securityAndAccessRights: KEY_ALL_ACCESS]) && [[OFWindowsRegistryKey currentUserKey] 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 |