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

Unified Diff: base/version_unittest.cc

Issue 2163033002: base::Version constructor from std::vector<uint32_t> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes based on nit 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 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
diff --git a/base/version_unittest.cc b/base/version_unittest.cc
index 5d9ea9973c9455a5293267dd054d8df2a6fd9f5d..fe445fb92592fee3ccaad8e9110878219915614d 100644
--- a/base/version_unittest.cc
+++ b/base/version_unittest.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <utility>
#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,6 +32,14 @@ TEST(VersionTest, ValueSemantics) {
EXPECT_EQ(v3, v1);
}
+TEST(VersionTest, MoveSemantics) {
+ const std::vector<uint32_t> components = {1, 2, 3, 4};
+ Version v1(std::move(components));
+ EXPECT_TRUE(v1.IsValid());
+ Version v2("1.2.3.4");
+ EXPECT_EQ(v1, v2);
+}
+
TEST(VersionTest, GetVersionFromString) {
static const struct version_string {
const char* input;
« 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