Eric Caruso | ea9f10e | 2019-05-01 09:52:01 -0700 | [diff] [blame] | 1 | // Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 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 <glib.h> |
| 6 | |
| 7 | #include <memory> |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <gtest/gtest.h> |
| 12 | |
| 13 | #include "glib-bridge/glib_logger.h" |
| 14 | |
| 15 | namespace glib_bridge { |
| 16 | |
| 17 | extern uint64_t g_num_logs; |
| 18 | |
| 19 | class GlibUnstructuredLoggerTest : public ::testing::Test { |
| 20 | public: |
| 21 | GlibUnstructuredLoggerTest() { |
| 22 | g_num_logs = 0; |
| 23 | ForwardLogs(); |
| 24 | } |
| 25 | ~GlibUnstructuredLoggerTest() override = default; |
| 26 | }; |
| 27 | |
| 28 | TEST_F(GlibUnstructuredLoggerTest, TestLogging) { |
| 29 | g_message("foo"); |
| 30 | EXPECT_EQ(g_num_logs, 1); |
| 31 | } |
| 32 | |
| 33 | } // namespace glib_bridge |