OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/version.h" | 6 #include "base/version.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 class VersionTest : public testing::Test { | 9 class VersionTest : public testing::Test { |
10 }; | 10 }; |
11 | 11 |
12 TEST_F(VersionTest, DefaultConstructor) { | 12 TEST_F(VersionTest, DefaultConstructor) { |
13 Version v; | 13 Version v; |
14 EXPECT_FALSE(v.is_valid_); | 14 EXPECT_FALSE(v.is_valid_); |
15 } | 15 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 {"1.0.0", "1.0", 0}, | 66 {"1.0.0", "1.0", 0}, |
67 {"1.0.3", "1.0.20", -1}, | 67 {"1.0.3", "1.0.20", -1}, |
68 }; | 68 }; |
69 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { | 69 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { |
70 scoped_ptr<Version> lhs(Version::GetVersionFromString(cases[i].lhs)); | 70 scoped_ptr<Version> lhs(Version::GetVersionFromString(cases[i].lhs)); |
71 scoped_ptr<Version> rhs(Version::GetVersionFromString(cases[i].rhs)); | 71 scoped_ptr<Version> rhs(Version::GetVersionFromString(cases[i].rhs)); |
72 EXPECT_EQ(lhs->CompareTo(*rhs), cases[i].expected) << | 72 EXPECT_EQ(lhs->CompareTo(*rhs), cases[i].expected) << |
73 cases[i].lhs << " ? " << cases[i].rhs; | 73 cases[i].lhs << " ? " << cases[i].rhs; |
74 } | 74 } |
75 } | 75 } |
OLD | NEW |