aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/skjson/src/SkJSONTest.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-06-14 18:41:39 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-14 18:41:50 +0000
commit0510edeebf76b8a9753acc06afde8b09a8f00a54 (patch)
treedbfb32906b2e6dc632860e574ccfd29682032222 /modules/skjson/src/SkJSONTest.cpp
parent28f5dd8a4c8aa053f417bcf7f1da94daa8915ca9 (diff)
Revert "[skjson] Size-constrained input API"
This reverts commit fc792b8718cc30e9da62c9559b23c1baac3166bb. Reason for revert: New ASAN, Android failures. Original change's description: > [skjson] Size-constrained input API > > Pass an explicit input size instead of requiring a C string. > > Thanks to mtklein's clever trick, this has no measurable perf impact. > > Change-Id: I64f210a9f653a78b05ab6b58fa34479504aa35ff > Reviewed-on: https://skia-review.googlesource.com/134940 > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Florin Malita <fmalita@chromium.org> TBR=mtklein@google.com,fmalita@chromium.org Change-Id: Ic0b52398b1ce6f64c781debb858829cb64bbae58 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/135022 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'modules/skjson/src/SkJSONTest.cpp')
-rw-r--r--modules/skjson/src/SkJSONTest.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/modules/skjson/src/SkJSONTest.cpp b/modules/skjson/src/SkJSONTest.cpp
index 91ae497cf0..6d4338cbbb 100644
--- a/modules/skjson/src/SkJSONTest.cpp
+++ b/modules/skjson/src/SkJSONTest.cpp
@@ -22,14 +22,8 @@ DEF_TEST(SkJSON_Parse, reporter) {
{ "" , nullptr },
{ "[" , nullptr },
{ "]" , nullptr },
- { "[[]" , nullptr },
- { "[]]" , nullptr },
- { "[]f" , nullptr },
{ "{" , nullptr },
{ "}" , nullptr },
- { "{{}" , nullptr },
- { "{}}" , nullptr },
- { "{}f" , nullptr },
{ "{]" , nullptr },
{ "[}" , nullptr },
{ "1" , nullptr },
@@ -57,9 +51,7 @@ DEF_TEST(SkJSON_Parse, reporter) {
{ "{ \"k\" : null \"k\" : 1 }", nullptr },
- { "[]" , "[]" },
{ " \n\r\t [ \n\r\t ] \n\r\t " , "[]" },
- { "[[]]" , "[[]]" },
{ "[ null ]" , "[null]" },
{ "[ true ]" , "[true]" },
{ "[ false ]" , "[false]" },
@@ -74,7 +66,6 @@ DEF_TEST(SkJSON_Parse, reporter) {
{ "[ \"123456789\" ]" , "[\"123456789\"]" },
{ "[ null , true, false,0,12.8 ]", "[null,true,false,0,12.8]" },
- { "{}" , "{}" },
{ " \n\r\t { \n\r\t } \n\r\t " , "{}" },
{ "{ \"k\" : null }" , "{\"k\":null}" },
{ "{ \"k1\" : null, \"k2 \":0 }", "{\"k1\":null,\"k2 \":0}" },
@@ -98,7 +89,7 @@ DEF_TEST(SkJSON_Parse, reporter) {
};
for (const auto& tst : g_tests) {
- DOM dom(tst.in, strlen(tst.in));
+ DOM dom(tst.in);
const auto success = !dom.root().is<NullValue>();
REPORTER_ASSERT(reporter, success == (tst.out != nullptr));
if (!success) continue;
@@ -162,7 +153,7 @@ DEF_TEST(SkJSON_DOM_visit, reporter) {
\"k8\": { \"kk1\": 2, \"kk2\": false, \"kk1\": \"baz\" } \n\
}";
- DOM dom(json, strlen(json));
+ DOM dom(json);
const auto& jroot = dom.root().as<ObjectValue>();
REPORTER_ASSERT(reporter, jroot.is<ObjectValue>());