Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1002)

Unified Diff: base/test/logging_utils.h

Issue 2638763004: Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Fix review issues. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/test/logging_utils.h
diff --git a/base/test/logging_utils.h b/base/test/logging_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..18497cbb716cf4486fa6b22fb89c8ff3c8fe5031
--- /dev/null
+++ b/base/test/logging_utils.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
Paweł Hajdan Jr. 2017/02/13 17:17:24 nit: No (c)
alex-ac 2017/02/14 10:34:28 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_TEST_LOGGING_UTILS_H_
+#define BASE_TEST_LOGGING_UTILS_H_
+
+#include "base/base_export.h"
+#include "base/callback.h"
+#include "base/logging.h"
+#include "base/macros.h"
+
+namespace logging {
+
+// Scoped object to set and restore Log Assert handler.
+BASE_EXPORT class ScopedLogAssertHandler {
+ public:
+ ScopedLogAssertHandler();
Paweł Hajdan Jr. 2017/02/13 17:17:24 Why do we need default ctor?
alex-ac 2017/02/14 10:34:28 It allows to use this object as an class variable
Paweł Hajdan Jr. 2017/02/14 19:23:26 Why don't we use unique_ptr instead, or some simil
alex-ac 2017/03/09 14:15:52 Done.
+ explicit ScopedLogAssertHandler(LogAssertHandlerFunction handler);
+ ScopedLogAssertHandler(ScopedLogAssertHandler&& other);
Paweł Hajdan Jr. 2017/02/13 17:17:24 Why do we need this and operator= ?
alex-ac 2017/02/14 10:34:28 Move-assignment operator allows to initialize defa
Paweł Hajdan Jr. 2017/02/14 19:23:26 To me it's another reason not to need these additi
alex-ac 2017/03/09 14:15:52 Done.
+ ~ScopedLogAssertHandler();
+
+ ScopedLogAssertHandler& operator=(ScopedLogAssertHandler&& other);
+
+ private:
+ LogAssertHandlerFunction handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedLogAssertHandler);
+};
+
+} // namespace logging
+
+#endif // BASE_TEST_LOGGING_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698