| Index: tests/GrGLSLPrettyPrintTest.cpp
|
| diff --git a/tests/GrGLSLPrettyPrintTest.cpp b/tests/GrGLSLPrettyPrintTest.cpp
|
| index 37aa5a88e172d933de477e6cb2aca6b680a4000f..9977488d58f759a9f7b2c5f925d784fe81b8d278 100644
|
| --- a/tests/GrGLSLPrettyPrintTest.cpp
|
| +++ b/tests/GrGLSLPrettyPrintTest.cpp
|
| @@ -13,16 +13,12 @@
|
|
|
| const SkString input1("#this is not a realshader\nvec4 some stuff;outside of a function;"
|
| "int i(int b, int c) { { some stuff;} fake block; //comments\n return i;}"
|
| - "void main()");
|
| -const SkString input2("{nowin a function;{indenting;{abit more;dreadedfor((;;)(;)((;;);)){"
|
| - "doingstuff"
|
| + "void main()"
|
| + "{nowin a function;{indenting;{abit more;dreadedfor((;;)(;)((;;);)){doingstuff"
|
| ";for(;;;){and more stufff;mixed garbage\n\n\t\t\t\t\n/*using this"
|
| - " comment\n is");
|
| -const SkString input3(" dangerous\ndo so at your own\n risk*/;\n\n\t\t\t\n"
|
| - "//a comment");
|
| -const SkString input4("breaking in comment");
|
| -const SkString input5("continuing the comment");
|
| -const SkString input6("\n}}a; little ; love; for ; leading; spaces;} "
|
| + " comment\n is"
|
| + " dangerous\ndo so at your own\n risk*/;\n\n\t\t\t\n"
|
| + "//a comment\n}}a; little ; love; for ; leading; spaces;} "
|
| "an struct = { int a; int b; };"
|
| "int[5] arr = int[5](1,2,3,4,5);} some code at the bottom; for(;;) {} }");
|
|
|
| @@ -56,7 +52,7 @@
|
| " 27\t\t\t\t\t\t is dangerous\n"
|
| " 28\t\t\t\t\t\tdo so at your own\n"
|
| " 29\t\t\t\t\t\t risk*/;\n"
|
| - " 30\t\t\t\t\t\t//a commentbreaking in commentcontinuing the comment\n"
|
| + " 30\t\t\t\t\t\t//a comment\n"
|
| " 31\t\t\t\t\t}\n"
|
| " 32\t\t\t\t}\n"
|
| " 33\t\t\t\ta;\n"
|
| @@ -81,43 +77,16 @@
|
| " 52\t}\n"
|
| " 53\t");
|
|
|
| -const SkString neg1("{;;{{{{;;;{{{{{{{{{{{");
|
| -const SkString neg2("###\n##\n#####(((((((((((((unbalanced verything;;;");
|
| -const SkString neg3("}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}"
|
| +const SkString input2("{;;{{{{;;;{{{{{{{{{{{###\n##\n#####(((((((((((((unbalanced verything;;;"
|
| + "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}"
|
| ";;;;;;/////");
|
|
|
| DEF_TEST(GrGLSLPrettyPrint, r) {
|
| - SkTArray<const char*> testStr;
|
| - SkTArray<int> lengths;
|
| - testStr.push_back(input1.c_str());
|
| - lengths.push_back(input1.size());
|
| - testStr.push_back(input2.c_str());
|
| - lengths.push_back(input2.size());
|
| - testStr.push_back(input3.c_str());
|
| - lengths.push_back(input3.size());
|
| - testStr.push_back(input4.c_str());
|
| - lengths.push_back(input4.size());
|
| - testStr.push_back(input5.c_str());
|
| - lengths.push_back(input5.size());
|
| - testStr.push_back(input6.c_str());
|
| - lengths.push_back(input6.size());
|
| -
|
| - SkString test = GrGLSLPrettyPrint::PrettyPrintGLSL(testStr.begin(), lengths.begin(),
|
| - testStr.count(), true);
|
| + SkString test = GrGLSLPrettyPrint::PrettyPrintGLSL(input1, true);
|
| ASSERT(output1 == test);
|
|
|
| - testStr.reset();
|
| - lengths.reset();
|
| - testStr.push_back(neg1.c_str());
|
| - lengths.push_back(neg1.size());
|
| - testStr.push_back(neg2.c_str());
|
| - lengths.push_back(neg2.size());
|
| - testStr.push_back(neg3.c_str());
|
| - lengths.push_back(neg3.size());
|
| -
|
| // Just test we don't crash with garbage input
|
| - ASSERT(GrGLSLPrettyPrint::PrettyPrintGLSL(testStr.begin(), lengths.begin(), 1,
|
| - true).c_str() != NULL);
|
| + ASSERT(GrGLSLPrettyPrint::PrettyPrintGLSL(input2, true).c_str() != NULL);
|
| }
|
|
|
| #endif
|
|
|