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

Unified Diff: base/pickle_unittest.cc

Issue 388213002: add double support to base::Pickle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: doc nit fix Created 6 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/pickle.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle_unittest.cc
diff --git a/base/pickle_unittest.cc b/base/pickle_unittest.cc
index bec25d2f5e2f153c68a26e65fc7a2e48d942811f..db529a4a2534e6ceeb96e1784f0e75159b263ac1 100644
--- a/base/pickle_unittest.cc
+++ b/base/pickle_unittest.cc
@@ -24,6 +24,7 @@ const bool testbool1 = false;
const bool testbool2 = true;
const uint16 testuint16 = 32123;
const float testfloat = 3.1415926935f;
+const double testdouble = 2.71828182845904523;
// checks that the result
void VerifyResult(const Pickle& pickle) {
@@ -55,6 +56,10 @@ void VerifyResult(const Pickle& pickle) {
EXPECT_TRUE(pickle.ReadFloat(&iter, &outfloat));
EXPECT_EQ(testfloat, outfloat);
+ double outdouble;
+ EXPECT_TRUE(pickle.ReadDouble(&iter, &outdouble));
+ EXPECT_EQ(testdouble, outdouble);
+
const char* outdata;
int outdatalen;
EXPECT_TRUE(pickle.ReadData(&iter, &outdata, &outdatalen));
@@ -77,6 +82,7 @@ TEST(PickleTest, EncodeDecode) {
EXPECT_TRUE(pickle.WriteBool(testbool2));
EXPECT_TRUE(pickle.WriteUInt16(testuint16));
EXPECT_TRUE(pickle.WriteFloat(testfloat));
+ EXPECT_TRUE(pickle.WriteDouble(testdouble));
EXPECT_TRUE(pickle.WriteData(testdata, testdatalen));
VerifyResult(pickle);
« no previous file with comments | « base/pickle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698