Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e12939f

Browse files
brianosmanSkia Commit-Bot
authored andcommitted
Unit tests for runtime effect SkSL errors found later in compilation
Forgot to add these when I fixed the bug. Verified that these tests failed without the fix. Bug: skia:10593 Change-Id: Ia20fad3cd8e5b0f63ca19946b8314eed49bec2bf Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309716 Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
1 parent c95b589 commit e12939f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/SkRuntimeEffectTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ DEF_TEST(SkRuntimeEffectInvalid, r) {
7373
test("in shader child1; in shader child2;",
7474
"color = sample(p.x > 10 ? child1 : child2);",
7575
"expression");
76+
77+
// Errors that aren't caught until later in the compilation process (during optimize())
78+
test("", "return; color.r = color.g;", "unreachable");
79+
test("half badFunc() { }", "", "without returning");
7680
}
7781

7882
DEF_TEST(SkRuntimeEffectInvalidColorFilters, r) {

0 commit comments

Comments
 (0)