/*
- * 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);