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

Unified Diff: base/json/json_writer_unittest.cc

Issue 8962042: Add TYPE_INTEGER64 type to base::Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/json/json_writer.cc ('k') | base/values.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_writer_unittest.cc
diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc
index 5d44c020efa5b59ce405dce26e98e484d60e18fc..f74714383f5a55b53fcdd8b08fa102c13fc18f56 100644
--- a/base/json/json_writer_unittest.cc
+++ b/base/json/json_writer_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/basictypes.h"
#include "base/json/json_writer.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -28,6 +29,12 @@ TEST(JSONWriterTest, Writing) {
ASSERT_EQ("[]", output_js);
delete root;
+ // Test 64-bit integers. These should not have an 'e'.
+ root = Value::CreateInteger64Value(kint64max);
+ JSONWriter::Write(root, false, &output_js);
+ ASSERT_EQ("9223372036854775807", output_js);
+ delete root;
+
// Test Real values should always have a decimal or an 'e'.
root = Value::CreateDoubleValue(1.0);
JSONWriter::Write(root, false, &output_js);
« no previous file with comments | « base/json/json_writer.cc ('k') | base/values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698