mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-08 10:23:54 +00:00
b9f732c31f
As per t5494224, all of the license headers in osquery needed to be updated to reflect the correct open source header style.
39 lines
994 B
C++
39 lines
994 B
C++
/*
|
|
* Copyright (c) 2014, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* 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 <boost/shared_ptr.hpp>
|
|
|
|
#include <gtest/gtest.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[]) {
|
|
testing::InitGoogleTest(&argc, argv);
|
|
return RUN_ALL_TESTS();
|
|
}
|