osquery-1/osquery/core/conversions_tests.cpp
mike@arpaia.co 073dd2d5c4 osquery thread pool
this is an implementation of a thread pool, using thrift's thread
manager class.
2014-09-12 08:18:25 -07:00

33 lines
806 B
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
#include <gtest/gtest.h>
#include <glog/logging.h>
#include "osquery/core/conversions.h"
namespace osquery {
class ConversionsTests : public testing::Test {};
class Foobar {};
TEST_F(ConversionsTests, test_conversion) {
boost::shared_ptr<Foobar> b1 = boost::make_shared<Foobar>();
std::shared_ptr<Foobar> s1 = boost_to_std_shared_ptr(b1);
EXPECT_EQ(s1.get(), b1.get());
std::shared_ptr<Foobar> s2 = std::make_shared<Foobar>();
boost::shared_ptr<Foobar> b2 = std_to_boost_shared_ptr(s2);
EXPECT_EQ(s2.get(), b2.get());
}
}
int main(int argc, char* argv[]) {
google::InitGoogleLogging(argv[0]);
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}