• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <string.h>
6 
7 #include <gtest/gtest.h>
8 
9 #include "include/trace_marker.h"
10 
11 namespace gestures {
12 
13 class TraceMarkerTest : public ::testing::Test {};
14 
TEST(TraceMarkerTest,DeleteTraceMarkerTest)15 TEST(TraceMarkerTest, DeleteTraceMarkerTest) {
16     EXPECT_EQ(NULL, TraceMarker::GetTraceMarker());
17     TraceMarker::CreateTraceMarker();
18     EXPECT_TRUE(NULL != TraceMarker::GetTraceMarker());
19     TraceMarker::StaticTraceWrite("Test");
20     EXPECT_EQ(-1, TraceMarker::GetTraceMarker()->fd_);
21     EXPECT_EQ(1, TraceMarker::trace_marker_count_);
22     TraceMarker::DeleteTraceMarker();
23     EXPECT_EQ(NULL, TraceMarker::GetTraceMarker());
24     TraceMarker::StaticTraceWrite("Test");
25     EXPECT_EQ(0, TraceMarker::trace_marker_count_);
26     TraceMarker::DeleteTraceMarker();
27     EXPECT_EQ(0, TraceMarker::trace_marker_count_);
28 };
29 }  // namespace gestures
30