diff options
author | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 20:21:01 +0000 |
---|---|---|
committer | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 20:21:01 +0000 |
commit | 32c147158f76e19aa22efa2a7b14d3f0e1e23a02 (patch) | |
tree | a84b94bc6c2e4e52d009db317ed49a343658634c /base/json_reader_unittest.cc | |
parent | 600a41fb05efe99eb2890e884a7af0541456c365 (diff) | |
download | chromium_src-32c147158f76e19aa22efa2a7b14d3f0e1e23a02.zip chromium_src-32c147158f76e19aa22efa2a7b14d3f0e1e23a02.tar.gz chromium_src-32c147158f76e19aa22efa2a7b14d3f0e1e23a02.tar.bz2 |
Port DictionaryValue to use string16 instead of wstring.
Review URL: http://codereview.chromium.org/31014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/json_reader_unittest.cc')
-rw-r--r-- | base/json_reader_unittest.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/base/json_reader_unittest.cc b/base/json_reader_unittest.cc index 9153289..b77f9d5 100644 --- a/base/json_reader_unittest.cc +++ b/base/json_reader_unittest.cc @@ -5,6 +5,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "base/json_reader.h" #include "base/scoped_ptr.h" +#include "base/string_util.h" #include "base/values.h" #include "build/build_config.h" @@ -297,14 +298,14 @@ TEST(JSONReaderTest, Reading) { ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); DictionaryValue* dict_val = static_cast<DictionaryValue*>(root.get()); real_val = 0.0; - ASSERT_TRUE(dict_val->GetReal(L"number", &real_val)); + ASSERT_TRUE(dict_val->GetReal(LIT16("number"), &real_val)); ASSERT_DOUBLE_EQ(9.87654321, real_val); Value* null_val = NULL; - ASSERT_TRUE(dict_val->Get(L"null", &null_val)); + ASSERT_TRUE(dict_val->Get(LIT16("null"), &null_val)); ASSERT_TRUE(null_val->IsType(Value::TYPE_NULL)); - str_val.clear(); - ASSERT_TRUE(dict_val->GetString(L"S", &str_val)); - ASSERT_EQ(L"str", str_val); + string16 str16_val; + ASSERT_TRUE(dict_val->GetString(LIT16("S"), &str16_val)); + ASSERT_EQ(LIT16("str"), str16_val); root2.reset(JSONReader::Read( "{\"number\":9.87654321, \"null\":null , \"\\x53\" : \"str\", }", true)); @@ -317,15 +318,15 @@ TEST(JSONReaderTest, Reading) { ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); dict_val = static_cast<DictionaryValue*>(root.get()); DictionaryValue* inner_dict = NULL; - ASSERT_TRUE(dict_val->GetDictionary(L"inner", &inner_dict)); + ASSERT_TRUE(dict_val->GetDictionary(LIT16("inner"), &inner_dict)); ListValue* inner_array = NULL; - ASSERT_TRUE(inner_dict->GetList(L"array", &inner_array)); + ASSERT_TRUE(inner_dict->GetList(LIT16("array"), &inner_array)); ASSERT_EQ(1U, inner_array->GetSize()); bool_value = true; - ASSERT_TRUE(dict_val->GetBoolean(L"false", &bool_value)); + ASSERT_TRUE(dict_val->GetBoolean(LIT16("false"), &bool_value)); ASSERT_FALSE(bool_value); inner_dict = NULL; - ASSERT_TRUE(dict_val->GetDictionary(L"d", &inner_dict)); + ASSERT_TRUE(dict_val->GetDictionary(LIT16("d"), &inner_dict)); root2.reset(JSONReader::Read( "{\"inner\": {\"array\":[true] , },\"false\":false,\"d\":{},}", true)); |