This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ impeller_component("base") {
3232
3333impeller_component (" base_unittests" ) {
3434 testonly = true
35- sources = [ " base_unittests.cc" ]
35+ sources = [
36+ " base_unittests.cc" ,
37+ " validation_unittests.cc" ,
38+ ]
3639 deps = [
3740 " :base" ,
3841 " //flutter/testing" ,
Original file line number Diff line number Diff line change 1111namespace impeller {
1212
1313static std::atomic_int32_t sValidationLogsDisabledCount = 0 ;
14- static std::atomic_int32_t sValidationLogsAreFatal = 0 ;
14+ static std::atomic_int32_t sValidationLogsAreFatal = 1 ;
1515
1616void ImpellerValidationErrorsSetFatal (bool fatal) {
1717 sValidationLogsAreFatal = fatal;
@@ -59,4 +59,15 @@ void ImpellerValidationBreak(const char* message) {
5959#endif // IMPELLER_ENABLE_VALIDATION
6060}
6161
62+ bool ImpellerValidationErrorsIsFatal () {
63+ return sValidationLogsAreFatal ;
64+ }
65+
66+ bool ImpellerValidationIsEnabled () {
67+ #ifdef IMPELLER_ENABLE_VALIDATION
68+ return true ;
69+ #else
70+ return false ;
71+ #endif
72+ }
6273} // namespace impeller
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ void ImpellerValidationBreak(const char* message);
3939
4040void ImpellerValidationErrorsSetFatal (bool fatal);
4141
42+ bool ImpellerValidationErrorsIsFatal ();
43+
44+ bool ImpellerValidationIsEnabled ();
45+
4246struct ScopedValidationDisable {
4347 ScopedValidationDisable ();
4448
You can’t perform that action at this time.
0 commit comments