Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "testing/gtest/include/gtest/gtest.h" | |
| 6 | |
| 7 #import "chrome/installer/mac/app/SystemInfo.h" | |
|
Mark Mentovai
2016/07/22 18:03:24
Likewise.
| |
| 8 | |
| 9 namespace { | |
| 10 | |
| 11 TEST(SystemInfoTest, GetArchReturnsExpectedString) { | |
| 12 NSString* arch = [SystemInfo getArch]; | |
| 13 | |
| 14 EXPECT_TRUE([arch isEqualToString:@"i486"] || | |
| 15 [arch isEqualToString:@"x86_64h"]); | |
| 16 } | |
| 17 | |
| 18 TEST(SystemInfoTest, GetOSVersionMatchesRegexFormat) { | |
| 19 NSString* os_version = [SystemInfo getOSVersion]; | |
| 20 | |
| 21 NSRegularExpression* regex = [NSRegularExpression | |
| 22 regularExpressionWithPattern:@"^10\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$" | |
| 23 options:0 | |
| 24 error:nil]; | |
| 25 NSUInteger matches = | |
| 26 [regex numberOfMatchesInString:os_version | |
| 27 options:0 | |
| 28 range:NSMakeRange(0, os_version.length)]; | |
| 29 EXPECT_EQ(1u, matches); | |
| 30 } | |
| 31 | |
| 32 } // namespace | |
| OLD | NEW |