folly: move side effects out of EXPECT_EQ args
authorJim Meyering <meyering@fb.com>
Fri, 13 Feb 2015 19:06:37 +0000 (11:06 -0800)
committerAlecs King <int@fb.com>
Tue, 3 Mar 2015 03:20:09 +0000 (19:20 -0800)
commit0234d5d11585e5e1a3c76a7ea5e99c3d925a06ca
tree6b8b1b5eb967990be6bf4a79ba21960671a9f34c
parentccb229d557f1d137473bd256739b379ffdd139e8
folly: move side effects out of EXPECT_EQ args

Summary:
This avoids warnings about e.g., sizeof(k++) that result
from macro expansion.
* folly/futures/test/ExecutorTest.cpp: Move increment out
of macro argument list.
* folly/test/FBVectorTestBenchmarks.cpp.h: Likewise.
* folly/test/LazyTest.cpp: Likewise.
Otherwise, we'd get errors like this:

folly/test/LazyTest.cpp:49:118: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]
switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar = (::testing::internal:: EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(++globalCount())) == 1)>::Compare("++globalCount()", "1", ++globalCount(), 1))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "folly/test/LazyTest.cpp", 49, gtest_ar.failure_message()) = ::testing::Message();
^

Test Plan:
Run these commands and note there are fewer errors than before:
fbconfig --clang --with-project-version=clang:dev -r folly && fbmake dbgo

Reviewed By: njormrod@fb.com

Subscribers: folly-diffs@, jsedgwick, yfeldblum

FB internal diff: D1848324

Tasks: 6244745

Signature: t1:1848324:1423860890:bce44c5e0895804a21957893ae6b78e76dfbc4d3
folly/futures/test/ExecutorTest.cpp
folly/test/FBVectorTestBenchmarks.cpp.h
folly/test/LazyTest.cpp