OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
| 8 #include "SkTypes.h" |
| 9 |
8 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
9 #include "Test.h" | 11 #include "Test.h" |
10 #include "gl/GrGLSLPrettyPrint.h" | 12 #include "gl/GrGLSLPrettyPrint.h" |
11 | 13 |
12 #define ASSERT(x) REPORTER_ASSERT(r, x) | 14 #define ASSERT(x) REPORTER_ASSERT(r, x) |
13 | 15 |
14 const SkString input1("#this is not a realshader\nvec4 some stuff;outside of a f
unction;" | 16 const SkString input1("#this is not a realshader\nvec4 some stuff;outside of a f
unction;" |
15 "int i(int b, int c) { { some stuff;} fake block; //comment
s\n return i;}" | 17 "int i(int b, int c) { { some stuff;} fake block; //comment
s\n return i;}" |
16 "void main()"); | 18 "void main()"); |
17 const SkString input2("{nowin a function;{indenting;{abit more;dreadedfor((;;)(;
)((;;);)){" | 19 const SkString input2("{nowin a function;{indenting;{abit more;dreadedfor((;;)(;
)((;;);)){" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 lengths.reset(); | 112 lengths.reset(); |
111 testStr.push_back(neg1.c_str()); | 113 testStr.push_back(neg1.c_str()); |
112 lengths.push_back((int)neg1.size()); | 114 lengths.push_back((int)neg1.size()); |
113 testStr.push_back(neg2.c_str()); | 115 testStr.push_back(neg2.c_str()); |
114 lengths.push_back((int)neg2.size()); | 116 lengths.push_back((int)neg2.size()); |
115 testStr.push_back(neg3.c_str()); | 117 testStr.push_back(neg3.c_str()); |
116 lengths.push_back((int)neg3.size()); | 118 lengths.push_back((int)neg3.size()); |
117 | 119 |
118 // Just test we don't crash with garbage input | 120 // Just test we don't crash with garbage input |
119 ASSERT(GrGLSLPrettyPrint::PrettyPrintGLSL(testStr.begin(), lengths.begin(),
1, | 121 ASSERT(GrGLSLPrettyPrint::PrettyPrintGLSL(testStr.begin(), lengths.begin(),
1, |
120 true).c_str() != NULL); | 122 true).c_str() != nullptr); |
121 } | 123 } |
122 | 124 |
123 #endif | 125 #endif |
OLD | NEW |