Fibers allocation/deallocation benchmarks
[folly.git] / folly / test / TraitsTest.cpp
index 90a31d0fefa5be82c135f41ac746651634e85981..e3776e2bdc8a58c66bd49e8917813337891f12f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -110,12 +110,13 @@ TEST(Traits, relational) {
   EXPECT_FALSE((folly::greater_than<uint8_t, 255u, uint8_t>(254u)));
 }
 
-struct CompleteType {};
-struct IncompleteType;
-TEST(Traits, is_complete) {
-  EXPECT_TRUE((folly::is_complete<int>::value));
-  EXPECT_TRUE((folly::is_complete<CompleteType>::value));
-  EXPECT_FALSE((folly::is_complete<IncompleteType>::value));
+struct membership_no {};
+struct membership_yes { using x = void; };
+FOLLY_CREATE_HAS_MEMBER_TYPE_TRAITS(has_member_type_x, x);
+
+TEST(Traits, has_member_type) {
+  EXPECT_FALSE(bool(has_member_type_x<membership_no>::value));
+  EXPECT_TRUE(bool(has_member_type_x<membership_yes>::value));
 }
 
 int main(int argc, char ** argv) {
@@ -126,4 +127,3 @@ int main(int argc, char ** argv) {
   }
   return RUN_ALL_TESTS();
 }
-