mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Make testcases more robust.
This commit is contained in:
parent
65163ebf48
commit
1feeb27b08
1 changed files with 7 additions and 6 deletions
|
@ -6,19 +6,20 @@ int main()
|
|||
{
|
||||
START_SET("Unbalanced unlocking")
|
||||
|
||||
NSLock *lock;
|
||||
|
||||
lock = [NSLock new];
|
||||
NSLock *lock = [NSLock new];
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
BOOL mode = [defs boolForKey: @"GSMacOSXCompatible"];
|
||||
|
||||
[defs setBool: NO forKey: @"GSMacOSXCompatible"];
|
||||
PASS_EXCEPTION([lock unlock], @"NSLockException",
|
||||
"unlocking an unlocked lock raises NSLockException")
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setBool: YES
|
||||
forKey: @"GSMacOSXCompatible"];
|
||||
|
||||
[defs setBool: YES forKey: @"GSMacOSXCompatible"];
|
||||
PASS_RUNS([lock unlock],
|
||||
"unlocking an unlocked lock does not raise in MacOSX compatibility mode")
|
||||
|
||||
[defs setBool: mode forKey: @"GSMacOSXCompatible"];
|
||||
|
||||
END_SET("Unbalanced unlocking")
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue