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

Unified Diff: base/pickle_unittest.cc

Issue 10818011: Allow floating point rectangles to be sent via IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
Index: base/pickle_unittest.cc
diff --git a/base/pickle_unittest.cc b/base/pickle_unittest.cc
index 8cb1d2a170c23e52e01d4798006338dc74ae3153..435155c07d6188d0dcdd7ff3891e2ba7cbf92ac0 100644
--- a/base/pickle_unittest.cc
+++ b/base/pickle_unittest.cc
@@ -20,6 +20,7 @@ const int testdatalen = arraysize(testdata) - 1;
const bool testbool1 = false;
const bool testbool2 = true;
const uint16 testuint16 = 32123;
+const float testfloat = 3.141592f;
// checks that the result
void VerifyResult(const Pickle& pickle) {
@@ -47,6 +48,10 @@ void VerifyResult(const Pickle& pickle) {
EXPECT_TRUE(pickle.ReadUInt16(&iter, &outuint16));
EXPECT_EQ(testuint16, outuint16);
+ float outfloat;
+ EXPECT_TRUE(pickle.ReadFloat(&iter, &outfloat));
+ EXPECT_EQ(testfloat, outfloat);
+
const char* outdata;
int outdatalen;
EXPECT_TRUE(pickle.ReadData(&iter, &outdata, &outdatalen));
@@ -72,6 +77,7 @@ TEST(PickleTest, EncodeDecode) {
EXPECT_TRUE(pickle.WriteBool(testbool1));
EXPECT_TRUE(pickle.WriteBool(testbool2));
EXPECT_TRUE(pickle.WriteUInt16(testuint16));
+ EXPECT_TRUE(pickle.WriteFloat(testfloat));
EXPECT_TRUE(pickle.WriteData(testdata, testdatalen));
// Over allocate BeginWriteData so we can test TrimWriteData.

Powered by Google App Engine
This is Rietveld 408576698