From 69d41f144ad82d652f148c303a168cd07d222d41 Mon Sep 17 00:00:00 2001 From: dvdli Date: Wed, 2 Dec 2020 15:20:20 +0800 Subject: fix typo, add comments to describe the tests and fix the loopback test --- tests/src/pcm_params_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/src/pcm_params_test.cc') diff --git a/tests/src/pcm_params_test.cc b/tests/src/pcm_params_test.cc index 18c3c2c..c8151e1 100644 --- a/tests/src/pcm_params_test.cc +++ b/tests/src/pcm_params_test.cc @@ -40,8 +40,9 @@ namespace tinyalsa { namespace testing { static inline unsigned int OrAllBits(const pcm_mask *mask) { + static constexpr size_t kTotalMaskBytes = 32; unsigned int res = 0; - for (uint32_t i = 0; i < 32 / sizeof(unsigned int); ++i) { + for (uint32_t i = 0; i < kTotalMaskBytes / sizeof(pcm_mask::bits[0]); ++i) { res |= mask->bits[i]; } return res; @@ -218,4 +219,4 @@ TEST(PcmParamsTest, GetPlaybackDeviceParams) { } } // namespace testing -} // namespace tinyalse +} // namespace tinyalsa -- cgit v1.2.3