projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add getSemiFuture to folly::Promise
[folly.git]
/
folly
/
futures
/
test
/
FSMTest.cpp
diff --git
a/folly/futures/test/FSMTest.cpp
b/folly/futures/test/FSMTest.cpp
index 1dd4f6bbfce83af08265816af85b64232139c9be..0217eda5f622c2300f9da4257a095f7dd6617f2e 100644
(file)
--- a/
folly/futures/test/FSMTest.cpp
+++ b/
folly/futures/test/FSMTest.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
6
Facebook, Inc.
+ * Copyright 201
7
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-14,11
+14,10
@@
* limitations under the License.
*/
* limitations under the License.
*/
-#include <gtest/gtest.h>
-
#include <folly/futures/detail/FSM.h>
#include <folly/futures/detail/FSM.h>
+#include <folly/portability/GTest.h>
-using namespace folly::detail;
+using namespace folly::
futures::
detail;
enum class State { A, B };
enum class State { A, B };
@@
-40,12
+39,16
@@
TEST(FSM, example) {
};
// keep retrying until success (like a cas)
};
// keep retrying until success (like a cas)
- while (!tryTransition()) ;
+ while (!tryTransition()) {
+ ;
+ }
EXPECT_EQ(State::B, fsm.getState());
EXPECT_EQ(1, count);
EXPECT_EQ(0, unprotectedCount);
EXPECT_EQ(State::B, fsm.getState());
EXPECT_EQ(1, count);
EXPECT_EQ(0, unprotectedCount);
- while (!tryTransition()) ;
+ while (!tryTransition()) {
+ ;
+ }
EXPECT_EQ(State::A, fsm.getState());
EXPECT_EQ(0, count);
EXPECT_EQ(-1, unprotectedCount);
EXPECT_EQ(State::A, fsm.getState());
EXPECT_EQ(0, count);
EXPECT_EQ(-1, unprotectedCount);