Audio HAL VTS: Fix style on modified files
In order to avoid style inconsistency as well as non functional
modification in following patches,
fix the style of all files modified for the fix of the VTS tests.
Patch generated with:
$ clang-format -i --style file -- <file list>
Bug: 36311550
Test: compile
Change-Id: I53dbcdabf959a6100e34a2ee4d0f951d525049cb
diff --git a/audio/2.0/vts/functional/utility/AssertOk.h b/audio/2.0/vts/functional/utility/AssertOk.h
index 10b088c..6891dc4 100644
--- a/audio/2.0/vts/functional/utility/AssertOk.h
+++ b/audio/2.0/vts/functional/utility/AssertOk.h
@@ -14,14 +14,15 @@
* limitations under the License.
*/
-#include <vector>
#include <algorithm>
+#include <vector>
#include <hidl/Status.h>
namespace detail {
-// This is a detail namespace, thus it is OK to import a class as nobody else is allowed to use it
+// This is a detail namespace, thus it is OK to import a class as nobody else is
+// allowed to use it
using ::android::hardware::Return;
using ::android::hardware::audio::V2_0::Result;
@@ -29,27 +30,28 @@
ASSERT_EQ(expected, result);
}
-inline void assertResult(Result expected, const Return<Result> &ret) {
+inline void assertResult(Result expected, const Return<Result>& ret) {
ASSERT_TRUE(ret.isOk());
Result result = ret;
assertResult(expected, result);
}
-inline void assertResult(const std::vector<Result> &expected, Result result) {
+inline void assertResult(const std::vector<Result>& expected, Result result) {
if (std::find(expected.begin(), expected.end(), result) != expected.end()) {
- return; // result is in expected
+ return; // result is in expected
}
FAIL() << "Expected result " << ::testing::PrintToString(result)
<< " to be one of " << ::testing::PrintToString(expected);
}
-inline void assertResult(const std::vector<Result> &expected, const Return<Result> &ret) {
+inline void assertResult(const std::vector<Result>& expected,
+ const Return<Result>& ret) {
ASSERT_TRUE(ret.isOk());
Result result = ret;
assertResult(expected, result);
}
-inline void assertOk(const Return<void> &ret) {
+inline void assertOk(const Return<void>& ret) {
ASSERT_TRUE(ret.isOk());
}
@@ -57,15 +59,16 @@
assertResult(Result::OK, result);
}
-inline void assertOk(const Return<Result> &ret) {
+inline void assertOk(const Return<Result>& ret) {
assertResult(Result::OK, ret);
}
-
}
// Test anything provided is and contains only OK
#define ASSERT_OK(ret) ASSERT_NO_FATAL_FAILURE(detail::assertOk(ret))
#define EXPECT_OK(ret) EXPECT_NO_FATAL_FAILURE(detail::assertOk(ret))
-#define ASSERT_RESULT(expected, ret) ASSERT_NO_FATAL_FAILURE(detail::assertResult(expected, ret))
-#define EXPECT_RESULT(expected, ret) EXPECT_NO_FATAL_FAILURE(detail::assertResult(expected, ret))
+#define ASSERT_RESULT(expected, ret) \
+ ASSERT_NO_FATAL_FAILURE(detail::assertResult(expected, ret))
+#define EXPECT_RESULT(expected, ret) \
+ EXPECT_NO_FATAL_FAILURE(detail::assertResult(expected, ret))