aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar Mark Mentovai <mark@chromium.org>2017-07-10 17:24:25 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2017-07-10 17:41:00 -0400
commitec72a2bc500a716369c383837bffdc7d2a22855b (patch)
tree51caaa4dff0df947186a969f697acd3d53f55a41 /UnitTesting
parentc867eb4055d715b8aa56e1ce630e739df3abdc0a (diff)
10.13 SDK (and iOS 11 equivalent) compatibility for GTM
Starting in the 10.6 SDK, the non-underscored and all-lowercase macro names in <AssertMacros.h> were deprecated. In the 10.13 SDK shipping in Xcode 9 beta 3 (but not previous betas of Xcode 9), Apple has made good on its promise to eventually disable these names. Update GTM to use the new underscored mixed-case names. Provided that nobody needs to target anything older than the 10.5 SDK anymore, this should be a safe change. Aside from GTMCarbonEvent.m, which is used by Chrome, this change is untested, and was made by mechanically replacing uses of the various check, require, and verify macros found in GTM.
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMAppKitUnitTestingUtilities.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/UnitTesting/GTMAppKitUnitTestingUtilities.m b/UnitTesting/GTMAppKitUnitTestingUtilities.m
index d90d608..8a83f81 100644
--- a/UnitTesting/GTMAppKitUnitTestingUtilities.m
+++ b/UnitTesting/GTMAppKitUnitTestingUtilities.m
@@ -62,12 +62,12 @@ static CGKeyCode GTMKeyCodeForCharCode(CGCharCode charCode);
+ (void)postKeyEvent:(NSEventType)type
character:(CGCharCode)keyChar
modifiers:(UInt32)cocoaModifiers {
- require(![self isScreenSaverActive], CantWorkWithScreenSaver);
- require(type == NSKeyDown || type == NSKeyUp, CantDoEvent);
+ __Require(![self isScreenSaverActive], CantWorkWithScreenSaver);
+ __Require(type == NSKeyDown || type == NSKeyUp, CantDoEvent);
CGKeyCode code = GTMKeyCodeForCharCode(keyChar);
- verify(code != 256);
+ __Verify(code != 256);
CGEventRef event = CGEventCreateKeyboardEvent(NULL, code, type == NSKeyDown);
- require(event, CantCreateEvent);
+ __Require(event, CantCreateEvent);
CGEventSetFlags(event, cocoaModifiers);
CGEventPost(kCGSessionEventTap, event);
CFRelease(event);