Index: third_party/crashpad/crashpad/util/mac/launchd_test.mm |
diff --git a/third_party/crashpad/crashpad/util/mac/launchd_test.mm b/third_party/crashpad/crashpad/util/mac/launchd_test.mm |
index 649e799d1e12f30dbf3ef002f35d0c0458d3e041..8d9db76239ceff347589bb89b2295018e1eabea1 100644 |
--- a/third_party/crashpad/crashpad/util/mac/launchd_test.mm |
+++ b/third_party/crashpad/crashpad/util/mac/launchd_test.mm |
@@ -62,9 +62,9 @@ |
NSNumber* integer_ns = integer_nses[index]; |
launch_data.reset(CFPropertyToLaunchData(integer_ns)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_INTEGER, LaunchDataGetType(launch_data.get())); |
- EXPECT_EQ([integer_ns longLongValue], |
- LaunchDataGetInteger(launch_data.get())) |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_INTEGER); |
+ EXPECT_EQ(LaunchDataGetInteger(launch_data.get()), |
+ [integer_ns longLongValue]) |
<< "index " << index; |
} |
} |
@@ -92,11 +92,11 @@ |
NSNumber* double_ns = double_nses[index]; |
launch_data.reset(CFPropertyToLaunchData(double_ns)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_REAL, LaunchDataGetType(launch_data.get())); |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_REAL); |
double expected_double_value = [double_ns doubleValue]; |
double observed_double_value = LaunchDataGetReal(launch_data.get()); |
bool expected_is_nan = std::isnan(expected_double_value); |
- EXPECT_EQ(expected_is_nan, std::isnan(observed_double_value)); |
+ EXPECT_EQ(std::isnan(observed_double_value), expected_is_nan); |
if (!expected_is_nan) { |
EXPECT_DOUBLE_EQ(expected_double_value, observed_double_value) |
<< "index " << index; |
@@ -118,7 +118,7 @@ |
NSNumber* bool_ns = bool_nses[index]; |
launch_data.reset(CFPropertyToLaunchData(bool_ns)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_BOOL, LaunchDataGetType(launch_data.get())); |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_BOOL); |
if ([bool_ns boolValue]) { |
EXPECT_TRUE(LaunchDataGetBool(launch_data.get())); |
} else { |
@@ -142,7 +142,7 @@ |
NSString* string_ns = string_nses[index]; |
launch_data.reset(CFPropertyToLaunchData(string_ns)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_data.get())); |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_STRING); |
EXPECT_STREQ([string_ns UTF8String], |
LaunchDataGetString(launch_data.get())); |
} |
@@ -158,11 +158,11 @@ |
NSData* data_ns = [NSData dataWithBytes:data_c length:sizeof(data_c)]; |
launch_data.reset(CFPropertyToLaunchData(data_ns)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_OPAQUE, LaunchDataGetType(launch_data.get())); |
- EXPECT_EQ(sizeof(data_c), LaunchDataGetOpaqueSize(launch_data.get())); |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_OPAQUE); |
+ EXPECT_EQ(LaunchDataGetOpaqueSize(launch_data.get()), sizeof(data_c)); |
EXPECT_EQ( |
- 0, |
- memcmp(LaunchDataGetOpaque(launch_data.get()), data_c, sizeof(data_c))); |
+ memcmp(LaunchDataGetOpaque(launch_data.get()), data_c, sizeof(data_c)), |
+ 0); |
} |
} |
@@ -176,13 +176,13 @@ |
launch_data.reset(CFPropertyToLaunchData(dictionary_ns)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_DICTIONARY, LaunchDataGetType(launch_data.get())); |
- EXPECT_EQ([dictionary_ns count], LaunchDataDictGetCount(launch_data.get())); |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_DICTIONARY); |
+ EXPECT_EQ(LaunchDataDictGetCount(launch_data.get()), [dictionary_ns count]); |
launch_data_t launch_lookup_data = |
LaunchDataDictLookup(launch_data.get(), "key"); |
ASSERT_TRUE(launch_lookup_data); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_lookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_lookup_data), LAUNCH_DATA_STRING); |
EXPECT_STREQ("value", LaunchDataGetString(launch_lookup_data)); |
} |
} |
@@ -195,18 +195,18 @@ |
launch_data.reset(CFPropertyToLaunchData(array_ns)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_ARRAY, LaunchDataGetType(launch_data.get())); |
- EXPECT_EQ([array_ns count], LaunchDataArrayGetCount(launch_data.get())); |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_ARRAY); |
+ EXPECT_EQ(LaunchDataArrayGetCount(launch_data.get()), [array_ns count]); |
launch_data_t launch_lookup_data = |
LaunchDataArrayGetIndex(launch_data.get(), 0); |
ASSERT_TRUE(launch_lookup_data); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_lookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_lookup_data), LAUNCH_DATA_STRING); |
EXPECT_STREQ("element_1", LaunchDataGetString(launch_lookup_data)); |
launch_lookup_data = LaunchDataArrayGetIndex(launch_data.get(), 1); |
ASSERT_TRUE(launch_lookup_data); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_lookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_lookup_data), LAUNCH_DATA_STRING); |
EXPECT_STREQ("element_2", LaunchDataGetString(launch_lookup_data)); |
} |
} |
@@ -251,54 +251,54 @@ |
launch_data.reset(CFPropertyToLaunchData(job_dictionary)); |
ASSERT_TRUE(launch_data.get()); |
- ASSERT_EQ(LAUNCH_DATA_DICTIONARY, LaunchDataGetType(launch_data.get())); |
- EXPECT_EQ(4u, LaunchDataDictGetCount(launch_data.get())); |
+ ASSERT_EQ(LaunchDataGetType(launch_data.get()), LAUNCH_DATA_DICTIONARY); |
+ EXPECT_EQ(LaunchDataDictGetCount(launch_data.get()), 4u); |
launch_data_t launch_lookup_data = |
LaunchDataDictLookup(launch_data.get(), LAUNCH_JOBKEY_LABEL); |
ASSERT_TRUE(launch_lookup_data); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_lookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_lookup_data), LAUNCH_DATA_STRING); |
EXPECT_STREQ("com.example.job.rebooter", |
LaunchDataGetString(launch_lookup_data)); |
launch_lookup_data = |
LaunchDataDictLookup(launch_data.get(), LAUNCH_JOBKEY_ONDEMAND); |
ASSERT_TRUE(launch_lookup_data); |
- ASSERT_EQ(LAUNCH_DATA_BOOL, LaunchDataGetType(launch_lookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_lookup_data), LAUNCH_DATA_BOOL); |
EXPECT_TRUE(LaunchDataGetBool(launch_lookup_data)); |
launch_lookup_data = |
LaunchDataDictLookup(launch_data.get(), LAUNCH_JOBKEY_PROGRAMARGUMENTS); |
ASSERT_TRUE(launch_lookup_data); |
- ASSERT_EQ(LAUNCH_DATA_ARRAY, LaunchDataGetType(launch_lookup_data)); |
- EXPECT_EQ(3u, LaunchDataArrayGetCount(launch_lookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_lookup_data), LAUNCH_DATA_ARRAY); |
+ EXPECT_EQ(LaunchDataArrayGetCount(launch_lookup_data), 3u); |
launch_data_t launch_sublookup_data = |
LaunchDataArrayGetIndex(launch_lookup_data, 0); |
ASSERT_TRUE(launch_sublookup_data); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_sublookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_sublookup_data), LAUNCH_DATA_STRING); |
EXPECT_STREQ("/bin/bash", LaunchDataGetString(launch_sublookup_data)); |
launch_sublookup_data = LaunchDataArrayGetIndex(launch_lookup_data, 1); |
ASSERT_TRUE(launch_sublookup_data); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_sublookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_sublookup_data), LAUNCH_DATA_STRING); |
EXPECT_STREQ("-c", LaunchDataGetString(launch_sublookup_data)); |
launch_sublookup_data = LaunchDataArrayGetIndex(launch_lookup_data, 2); |
ASSERT_TRUE(launch_sublookup_data); |
- ASSERT_EQ(LAUNCH_DATA_STRING, LaunchDataGetType(launch_sublookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_sublookup_data), LAUNCH_DATA_STRING); |
EXPECT_STREQ("/sbin/reboot", LaunchDataGetString(launch_sublookup_data)); |
launch_lookup_data = |
LaunchDataDictLookup(launch_data.get(), LAUNCH_JOBKEY_MACHSERVICES); |
ASSERT_TRUE(launch_lookup_data); |
- ASSERT_EQ(LAUNCH_DATA_DICTIONARY, LaunchDataGetType(launch_lookup_data)); |
- EXPECT_EQ(1u, LaunchDataDictGetCount(launch_lookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_lookup_data), LAUNCH_DATA_DICTIONARY); |
+ EXPECT_EQ(LaunchDataDictGetCount(launch_lookup_data), 1u); |
launch_sublookup_data = LaunchDataDictLookup( |
launch_lookup_data, "com.example.service.rebooter"); |
ASSERT_TRUE(launch_sublookup_data); |
- ASSERT_EQ(LAUNCH_DATA_BOOL, LaunchDataGetType(launch_sublookup_data)); |
+ ASSERT_EQ(LaunchDataGetType(launch_sublookup_data), LAUNCH_DATA_BOOL); |
EXPECT_TRUE(LaunchDataGetBool(launch_sublookup_data)); |
} |
} |