Explicitly use !basic_istream::fail() in test.
authorPeter Griess <pgriess@fb.com>
Thu, 26 Sep 2013 13:55:12 +0000 (08:55 -0500)
committerPeter Griess <pgriess@fb.com>
Tue, 15 Oct 2013 01:46:52 +0000 (18:46 -0700)
Summary:
- Looks like libc++ doesn't support operator bool() for streams? Use
!fail() explicitly to work around this.

Test Plan:
- fbconfig -r folly && fbmake runtests
- ./configure && make check on Ubuntu/FC/Mac

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D998596

folly/test/FBStringTest.cpp

index 36c8fe559cd9f76f2946044c47189c64e242cc6e..ddc8a646ea7d6be82de4a87d9816bae14c0b3097 100644 (file)
@@ -1029,7 +1029,7 @@ sed nisl. In diam lacus, lobortis ut posuere nec, ornare id quam.";
     ifstream input(f);
     fbstring line;
     FOR_EACH (i, v) {
-      EXPECT_TRUE(getline(input, line));
+      EXPECT_TRUE(!getline(input, line).fail());
       EXPECT_EQ(line, *i);
     }
   }