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

Unified Diff: base/version_unittest.cc

Issue 7105008: Clean up base/Version (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/version.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
}
« no previous file with comments | « base/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698