OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "base/json/json_reader.h" | 6 #include "base/json/json_reader.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 | 14 |
15 TEST(JSONReaderTest, Reading) { | 15 TEST(JSONReaderTest, Reading) { |
16 // some whitespace checking | 16 // some whitespace checking |
17 scoped_ptr<Value> root; | 17 scoped_ptr<Value> root; |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 | 557 |
558 root.reset(JSONReader::ReadAndReturnError("[\"xxx\\q\"]", false, | 558 root.reset(JSONReader::ReadAndReturnError("[\"xxx\\q\"]", false, |
559 &error_code, &error_message)); | 559 &error_code, &error_message)); |
560 EXPECT_FALSE(root.get()); | 560 EXPECT_FALSE(root.get()); |
561 EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape), | 561 EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape), |
562 error_message); | 562 error_message); |
563 EXPECT_EQ(JSONReader::JSON_INVALID_ESCAPE, error_code); | 563 EXPECT_EQ(JSONReader::JSON_INVALID_ESCAPE, error_code); |
564 } | 564 } |
565 | 565 |
566 } // namespace base | 566 } // namespace base |
OLD | NEW |