(Wangle) Sanity check for the small_vector test
authorHannes Roth <hannesr@fb.com>
Thu, 20 Mar 2014 17:11:14 +0000 (10:11 -0700)
committerDave Watson <davejwatson@fb.com>
Mon, 31 Mar 2014 17:44:29 +0000 (10:44 -0700)
Summary:
Let's double check that `small_vector` is doing the right thing. So
it doesn't just accidentally work.

Test Plan:
`fbconfig folly/wangle && fbmake runtests`
`fbconfig --clang folly/wangle && fbmake runtests`

Reviewed By: marccelani@fb.com

FB internal diff: D1231360

folly/wangle/test/FutureTest.cpp

index 8afbdc177bd259c40972fe56313c692ed54f7593..a362e9bf4b5cef61ded48983195e4a4bfa82deeb 100644 (file)
@@ -520,6 +520,12 @@ TEST(when, whenN) {
 
 /* Ensure that we can compile when_{all,any} with folly::small_vector */
 TEST(when, small_vector) {
+
+  static_assert(!FOLLY_IS_TRIVIALLY_COPYABLE(Future<void>),
+                "Futures should not be trivially copyable");
+  static_assert(!FOLLY_IS_TRIVIALLY_COPYABLE(Future<int>),
+                "Futures should not be trivially copyable");
+
   using folly::small_vector;
   {
     small_vector<Future<void>> futures;