]> granicus.if.org Git - clang/commitdiff
Fix test better way.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 19 Sep 2012 16:20:17 +0000 (16:20 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 19 Sep 2012 16:20:17 +0000 (16:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164234 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/for-range-examples.cpp

index 86899bd2ea5fc26b042f6c4a457e90661aaa51cc..953c98b4c81800b6866a880aefbd988078c40131 100644 (file)
@@ -115,19 +115,19 @@ namespace map_range {
   }
 }
 
-#define assert(b) if (!b) { return 1; }
+#define assert(b) if (!(b)) { return 1; }
 int main() {
   int total = 0;
 
   for (auto n : range(1, 5)) {
     total += n;
   }
-  assert((total == 10));
+  assert(total == 10);
 
   for (auto n : range(10, 100, 10)) {
     total += n;
   }
-  assert((total == 460));
+  assert(total == 460);
 
   map_range::vector<char> chars;
   chars.push_back('a');
@@ -136,7 +136,7 @@ int main() {
   for (char c : chars) {
     ++total;
   }
-  assert((total == 463));
+  assert(total == 463);
 
   typedef map_range::tuple<int, double> T;
   map_range::vector<T> pairs;
@@ -146,7 +146,7 @@ int main() {
   for (auto a : map(map_range::mem_fun(&T::get<int>), pairs)) {
     total += a;
   }
-  assert((total == 500));
+  assert(total == 500);
 }
 
 // PR11793