Home | History | Annotate | Download | only in source
      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 
     11 #include "system_wrappers/source/unittest_utilities.h"
     12 
     13 #include "gtest/gtest.h"
     14 #include "system_wrappers/interface/trace.h"
     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
     35