Migrate tests to use MockWarningHandler for warning interception.

PiperOrigin-RevId: 933656759
Change-Id: Ia21514c302799034bf598445933dd90427284737
This commit is contained in:
Yuval Tassa
2026-06-17 05:06:15 -07:00
committed by Copybara-Service
parent 38c3388046
commit cedaa47d61
9 changed files with 72 additions and 122 deletions
+3 -2
View File
@@ -117,8 +117,9 @@ class MockWarningHandler {
// Mock method called when a warning is intercepted.
MOCK_METHOD(void, Warn, (const std::string& msg));
// Allow any number of warnings without triggering test failure.
void ExpectWarnings();
// Allow any number of warnings (if empty) or expect at least one warning
// containing the specified substring (if non-empty).
void ExpectWarnings(std::string_view substring = "");
// Returns the thread-local active mock warning handler.
static MockWarningHandler* GetActive();