hta@webrtc.org | 86a6aac | 2012-06-18 13:22:08 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
pbos@webrtc.org | acaf3a1 | 2013-05-27 15:07:45 +0000 | [diff] [blame] | 11 | #include "webrtc/system_wrappers/source/unittest_utilities.h" |
hta@webrtc.org | 86a6aac | 2012-06-18 13:22:08 +0000 | [diff] [blame] | 12 | |
pbos@webrtc.org | acaf3a1 | 2013-05-27 15:07:45 +0000 | [diff] [blame] | 13 | #include "testing/gtest/include/gtest/gtest.h" |
| 14 | #include "webrtc/system_wrappers/interface/trace.h" |
hta@webrtc.org | 86a6aac | 2012-06-18 13:22:08 +0000 | [diff] [blame] | 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | // These tests merely check that the code compiles and that no |
| 19 | // fatal accidents happen when logging. |
| 20 | TEST(UnittestUtilities, TraceOn) { |
| 21 | ScopedTracing trace(true); |
| 22 | WEBRTC_TRACE(kTraceInfo, kTraceUtility, 0, "Log line that should appear"); |
| 23 | // TODO(hta): Verify that output appears. |
| 24 | // Note - output is written on another thread, so can take time to appear. |
| 25 | } |
| 26 | |
| 27 | TEST(UnittestUtilities, TraceOff) { |
| 28 | ScopedTracing trace(false); |
| 29 | WEBRTC_TRACE(kTraceInfo, kTraceUtility, 0, |
| 30 | "Log line that should not appear"); |
| 31 | // TODO(hta): Verify that no output appears. |
| 32 | } |
| 33 | |
| 34 | } // namespace webrtc |