Don't generate empty statements in DeterministicScheduleTest
[folly.git] / folly / test / DeterministicScheduleTest.cpp
index bdf7ebcbe85a37f4dfda0b74c886d21c3990fb43..2dc67e532d0ee3931352bd4bdaa72a71e74e674e 100644 (file)
@@ -234,17 +234,17 @@ DEFINE_bool(bug, false, "Introduce bug");
 
 /** Macro for inline definition of auxiliary actions */
 #define AUX_ACT(act)                          \
-  {                                           \
+  do {                                        \
     AUX_THR(func_) = __func__;                \
     AUX_THR(line_) = __LINE__;                \
     AuxAct auxfn(                             \
       [&](bool success) {                     \
-        if (success);                         \
+        if (success) {}                       \
         if (true) {act}                       \
       }                                       \
     );                                        \
     DeterministicSchedule::setAuxAct(auxfn);  \
-  }
+  } while (0)
 
 /** Alias for original class */
 template <typename T>