Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: chrome/installer/mac/app/testing/SystemInfo_test.mm

Issue 2137743002: Added test files for SystemInfo.m and OmahaXMLRequest.m. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments & made progress on roughly half of Mark's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 #import "testing/gtest/include/gtest/gtest.h"
6
7 #import "chrome/installer/mac/app/SystemInfo.h"
8
9 namespace {
10
11 class SystemInfoTest : public ::testing::Test {};
12
13 TEST(SystemInfoTest, GetArchDoesNotReturnNil) {
14 EXPECT_TRUE([SystemInfo getArch]);
15 }
16
17 TEST(SystemInfoTest, GetArchReturnsAString) {
18 EXPECT_TRUE([[SystemInfo getArch] isKindOfClass:[NSString class]]);
19 }
20
21 TEST(SystemInfoTest, GetArchReturnsAtLeastThreeCharacters) {
22 EXPECT_GE((int)[[SystemInfo getArch] length], 3);
23 }
24
25 TEST(SystemInfoTest, GetOSVersionDoesNotReturnNil) {
26 EXPECT_TRUE([SystemInfo getOSVersion]);
27 }
28
29 TEST(SystemInfoTest, GetOSVersionReturnsAString) {
30 EXPECT_TRUE([[SystemInfo getOSVersion] isKindOfClass:[NSString class]]);
31 }
32
33 TEST(SystemInfoTest, GetOSVersionReturnsAtLeastThreeCharacters) {
34 EXPECT_GE((int)[[SystemInfo getOSVersion] length], 3);
35 }
36
37 TEST(SystemInfoTest, GetOSVersionContainsPeriodDelimiters) {
38 EXPECT_NE([[SystemInfo getOSVersion] rangeOfString:@"."
39 options:NSCaseInsensitiveSearch]
40 .location,
41 (unsigned)NSNotFound);
42 }
43
44 TEST(SystemInfoTest, GetOSVersionReturnsNumbers) {
45 NSArray* substrings =
46 [[SystemInfo getOSVersion] componentsSeparatedByString:@"."];
47 for (NSString* s in substrings) {
48 EXPECT_TRUE(([s intValue] != 0) || [s isEqualToString:@"0"]);
49 }
50 }
51
52 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698