Index: base/version_unittest.cc |
=================================================================== |
--- base/version_unittest.cc (revision 86383) |
+++ base/version_unittest.cc (working copy) |
@@ -11,9 +11,23 @@ |
TEST_F(VersionTest, DefaultConstructor) { |
Version v; |
- EXPECT_FALSE(v.is_valid_); |
+ EXPECT_FALSE(v.IsValid()); |
} |
+TEST_F(VersionTest, ValueSemantics) { |
+ Version v1("1.2.3.4"); |
+ EXPECT_TRUE(v1.IsValid()); |
+ Version v3; |
+ EXPECT_FALSE(v3.IsValid()); |
+ { |
+ Version v2(v1); |
+ v3 = v2; |
+ EXPECT_TRUE(v2.IsValid()); |
+ EXPECT_TRUE(v1.Equals(v2)); |
+ } |
+ EXPECT_TRUE(v3.Equals(v1)); |
+} |
+ |
TEST_F(VersionTest, GetVersionFromString) { |
static const struct version_string { |
const char* input; |
@@ -43,7 +57,7 @@ |
scoped_ptr<Version> vers(Version::GetVersionFromString(cases[i].input)); |
EXPECT_EQ(cases[i].success, vers.get() != NULL); |
if (cases[i].success) { |
- EXPECT_TRUE(vers->is_valid_); |
+ EXPECT_TRUE(vers->IsValid()); |
EXPECT_EQ(cases[i].parts, vers->components().size()); |
} |
} |