Let Baton methods be noexcept
[folly.git] / folly / test / LazyTest.cpp
index d2947de2a412e3de3e1c4391616ac21ffa5125f0..947ee8dbc5b08896e317718c1a68a11fc16cbbe3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 #include <folly/Lazy.h>
 
-#include <map>
 #include <functional>
 #include <iostream>
+#include <map>
 
-#include <gtest/gtest.h>
+#include <folly/portability/GTest.h>
 
 namespace folly {
 
@@ -27,7 +27,8 @@ TEST(Lazy, Simple) {
   int computeCount = 0;
 
   auto const val = folly::lazy([&]() -> int {
-    EXPECT_EQ(++computeCount, 1);
+    ++computeCount;
+    EXPECT_EQ(computeCount, 1);
     return 12;
   });
   EXPECT_EQ(computeCount, 0);
@@ -46,7 +47,8 @@ TEST(Lazy, Simple) {
 
 auto globalCount = folly::lazy([]{ return 0; });
 auto const foo = folly::lazy([]() -> std::string {
-  EXPECT_EQ(++globalCount(), 1);
+  ++globalCount();
+  EXPECT_EQ(globalCount(), 1);
   return std::string("YEP");
 });
 
@@ -72,7 +74,7 @@ TEST(Lazy, Map) {
 struct CopyCount {
   CopyCount() {}
   CopyCount(const CopyCount&) { ++count; }
-  CopyCount(CopyCount&&)      {}
+  CopyCount(CopyCount&&) noexcept {}
 
   static int count;
 
@@ -104,5 +106,4 @@ TEST(Lazy, Consty) {
   EXPECT_EQ(lz(), 12);
 }
 
-}
-
+} // namespace folly