Enable clang-format in the tests
Extend the clang_format.py script to format everything by trace files in
the `test/` directory. Also, we have to add "on/off" marker in
`test-simualtor-inputs-aarch64.h` as clang-format is getting confused
there.
Change-Id: I1159498072bda1bfd049082aeccb347ec55e7825
diff --git a/test/test-invalset.cc b/test/test-invalset.cc
index f8af5bf..f3aeb91 100644
--- a/test/test-invalset.cc
+++ b/test/test-invalset.cc
@@ -31,7 +31,7 @@
// This file contains tests for the `InvalSet` and `InvalSetIterator` classes.
-#define TEST(name) TEST_(INVALSET_##name)
+#define TEST(name) TEST_(INVALSET_##name)
typedef ptrdiff_t KeyType;
typedef ptrdiff_t ValType;
@@ -48,16 +48,14 @@
return (key_ == other.key_) && (val_ == other.val_);
}
bool operator<(const Obj& other) const {
- return (key_ < other.key_) ||
- ((key_ == other.key_) && (val_ < other.val_));
+ return (key_ < other.key_) || ((key_ == other.key_) && (val_ < other.val_));
}
bool operator<=(const Obj& other) const {
return (key_ <= other.key_) ||
- ((key_ == other.key_) && (val_ <= other.val_));
+ ((key_ == other.key_) && (val_ <= other.val_));
}
bool operator>(const Obj& other) const {
- return (key_ > other.key_) ||
- ((key_ == other.key_) && (val_ > other.val_));
+ return (key_ > other.key_) || ((key_ == other.key_) && (val_ > other.val_));
}
};
@@ -73,7 +71,7 @@
kReclaimFrom,
kReclaimFactor> TestSet;
-template<>
+template <>
inline KeyType InvalSet<Obj,
kNPreallocatedElements,
KeyType,
@@ -82,7 +80,7 @@
kReclaimFactor>::GetKey(const Obj& obj) {
return obj.key_;
}
-template<>
+template <>
inline void InvalSet<Obj,
kNPreallocatedElements,
KeyType,
@@ -234,8 +232,7 @@
VIXL_CHECK(total == expected_total);
// Test with more elements.
- for (unsigned i = kNPreallocatedElements;
- i < 4 * kNPreallocatedElements;
+ for (unsigned i = kNPreallocatedElements; i < 4 * kNPreallocatedElements;
i++) {
set.insert(Obj(i, i));
expected_total += i;
@@ -304,8 +301,7 @@
VIXL_CHECK(total == expected_total);
// Test with more elements.
- for (unsigned i = kNPreallocatedElements;
- i < 4 * kNPreallocatedElements;
+ for (unsigned i = kNPreallocatedElements; i < 4 * kNPreallocatedElements;
i++) {
set.insert(Obj(i, i));
expected_total += i;
@@ -355,10 +351,10 @@
TEST(stl_forward_iterator) {
{
- TestSet::iterator default_it; // Default-constructible.
- TestSet::iterator copy_it(default_it); // Copy-constructible.
- copy_it = default_it; // Copy-assignable.
- } // Destructible.
+ TestSet::iterator default_it; // Default-constructible.
+ TestSet::iterator copy_it(default_it); // Copy-constructible.
+ copy_it = default_it; // Copy-assignable.
+ } // Destructible.
TestSet set1;
VIXL_CHECK(set1.empty() && (set1.size() == 0));