Fix copyright lines
[folly.git] / folly / futures / test / SharedPromiseTest.cpp
index 36b5169b5bbd3b1ed66de6fb36ac02af60e7496b..5c90a45a9d2fb51eab8dcecb7aa2184ca26037d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2015-present 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(SharedPromise, setGetSemiFuture) {
+  SharedPromise<int> p;
+  p.setValue(1);
+  auto f1 = p.getSemiFuture();
+  auto f2 = p.getSemiFuture();
+  EXPECT_EQ(1, f1.value());
+  EXPECT_EQ(1, f2.value());
+}
+
+TEST(SharedPromise, setGetMixed) {
+  SharedPromise<int> p;
+  p.setValue(1);
+  auto f1 = p.getSemiFuture();
+  auto f2 = p.getFuture();
+  EXPECT_EQ(1, f1.value());
+  EXPECT_EQ(1, f2.value());
+}
+
 TEST(SharedPromise, setGet) {
   SharedPromise<int> p;
   p.setValue(1);