re-land of switched skslc from std::string to SkString
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5084
Change-Id: Ib21c30afc0d8483392b417e660b7fecfcc30e617
Reviewed-on: https://skia-review.googlesource.com/5084
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/tests/SkSLErrorTest.cpp b/tests/SkSLErrorTest.cpp
index e9e05c1..c9e342c 100644
--- a/tests/SkSLErrorTest.cpp
+++ b/tests/SkSLErrorTest.cpp
@@ -9,24 +9,25 @@
#include "Test.h"
-#if SKIA_SUPPORT_GPU
+#if SK_SUPPORT_GPU
static void test_failure(skiatest::Reporter* r, const char* src, const char* error) {
SkSL::Compiler compiler;
- std::stringstream out;
- bool result = compiler.toSPIRV(SkSL::Program::kFragment_Kind, src, out);
- if (compiler.errorText() != error) {
+ SkDynamicMemoryWStream out;
+ bool result = compiler.toSPIRV(SkSL::Program::kFragment_Kind, SkString(src), out);
+ SkString skError(error);
+ if (compiler.errorText() != skError) {
SkDebugf("SKSL ERROR:\n source: %s\n expected: %s received: %s", src, error,
compiler.errorText().c_str());
}
REPORTER_ASSERT(r, !result);
- REPORTER_ASSERT(r, compiler.errorText() == error);
+ REPORTER_ASSERT(r, compiler.errorText() == skError);
}
static void test_success(skiatest::Reporter* r, const char* src) {
SkSL::Compiler compiler;
- std::stringstream out;
- bool result = compiler.toSPIRV(SkSL::Program::kFragment_Kind, src, out);
+ SkDynamicMemoryWStream out;
+ bool result = compiler.toSPIRV(SkSL::Program::kFragment_Kind, SkString(src), out);
REPORTER_ASSERT(r, result);
}