osquery-1/osquery/dispatcher/tests/dispatcher_tests.cpp

36 lines
815 B
C++
Raw Normal View History

/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
2015-04-27 09:12:58 +00:00
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <boost/make_shared.hpp>
#include <gtest/gtest.h>
2015-02-19 23:19:00 +00:00
#include "osquery/dispatcher/dispatcher.h"
namespace osquery {
class DispatcherTests : public testing::Test {
void TearDown() override {}
};
TEST_F(DispatcherTests, test_singleton) {
2015-05-04 03:02:01 +00:00
auto& one = Dispatcher::instance();
auto& two = Dispatcher::instance();
EXPECT_EQ(&one, &two);
}
2015-02-04 03:55:16 +00:00
class TestRunnable : public InternalRunnable {
public:
int* i;
2015-02-24 11:47:12 +00:00
explicit TestRunnable(int* i) : i(i) {}
2015-05-06 00:09:07 +00:00
virtual void start() { ++*i; }
};
}