Report the effect type when TestCreate returns null.
This is a quality-of-life improvement when debugging processor
unit tests.
Change-Id: I6eba2ea17710e224852e4688c5cc491ed09461ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305690
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/GrProcessorUnitTest.cpp b/src/gpu/GrProcessorUnitTest.cpp
index 5336b5b..186901d 100644
--- a/src/gpu/GrProcessorUnitTest.cpp
+++ b/src/gpu/GrProcessorUnitTest.cpp
@@ -58,8 +58,9 @@
}
template <class ProcessorSmartPtr>
-GrProcessorTestFactory<ProcessorSmartPtr>::GrProcessorTestFactory(MakeProc makeProc) {
- fMakeProc = makeProc;
+GrProcessorTestFactory<ProcessorSmartPtr>::GrProcessorTestFactory(MakeProc makeProc,
+ const char* name)
+ : fMakeProc(makeProc), fName(name) {
GetFactories()->push_back(this);
}
@@ -79,7 +80,9 @@
SkASSERT(idx < GetFactories()->count());
GrProcessorTestFactory<ProcessorSmartPtr>* factory = (*GetFactories())[idx];
ProcessorSmartPtr processor = factory->fMakeProc(data);
- SkASSERT(processor);
+ if (processor == nullptr) {
+ SK_ABORT("%s: TestCreate returned null", factory->fName.c_str());
+ }
return processor;
}