folly: allow folly::init to build on systems without the symbolizer (macOS)
[folly.git] / folly / test / MemoryTest.cpp
index c9a2b0ea6d95c3bd70717cd76852f729b25f5ce1..d61934024738f0fa1391ebedee4ad171f5b7bf42 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 using namespace folly;
 
-TEST(shared_ptr, example) {
-  auto uptr = make_unique<std::string>("hello");
-  auto sptr = to_shared_ptr(std::move(uptr));
-  EXPECT_EQ(nullptr, uptr);
-  EXPECT_EQ("hello", *sptr);
+TEST(make_unique, compatible_with_std_make_unique) {
+  //  HACK: To enforce that `folly::` is imported here.
+  to_shared_ptr(std::unique_ptr<std::string>());
+
+  using namespace std;
+  make_unique<string>("hello, world");
 }
 
 template <std::size_t> struct T {};
@@ -92,11 +93,3 @@ TEST(rebind_allocator, sanity_check) {
   s.reset();
   ASSERT_EQ(nullptr, s.get());
 }
-
-int main(int argc, char **argv) {
-  FLAGS_logtostderr = true;
-  google::InitGoogleLogging(argv[0]);
-  testing::InitGoogleTest(&argc, argv);
-
-  return RUN_ALL_TESTS();
-}