aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordvdli <70133153+dvdli@users.noreply.github.com>2021-02-01 13:29:04 +0800
committerGitHub <noreply@github.com>2021-02-01 13:29:04 +0800
commit1c5fb68ced57d838f2b7ecd0c00bc1fefc9ab60d (patch)
tree8b6a2d44a4291fa0c2cd3a79edbe123f52bb7a01 /tests
parent8c5da09cd7c6b35323a61e50c9e988694eb81a8e (diff)
parent5e65c16b305b9e4a3ca858cfb1b7a188db0d5242 (diff)
Merge pull request #198 from dvdli/tinyalsa-dev
fix bugs
Diffstat (limited to 'tests')
-rw-r--r--tests/src/mixer_test.cc2
-rw-r--r--tests/src/pcm_in_test.cc1
-rw-r--r--tests/src/pcm_out_test.cc6
3 files changed, 5 insertions, 4 deletions
diff --git a/tests/src/mixer_test.cc b/tests/src/mixer_test.cc
index 717269c..903fb8f 100644
--- a/tests/src/mixer_test.cc
+++ b/tests/src/mixer_test.cc
@@ -288,7 +288,7 @@ TEST_P(MixerControlsTest, Event) {
EXPECT_EQ(mixer_wait_event(mixer_object, 1000), 1);
- EXPECT_EQ(mixer_consume_event(mixer_object), 0);
+ EXPECT_EQ(mixer_consume_event(mixer_object), 1);
thread.join();
ASSERT_EQ(mixer_subscribe_events(mixer_object, 0), 0);
diff --git a/tests/src/pcm_in_test.cc b/tests/src/pcm_in_test.cc
index e912abb..4d8a697 100644
--- a/tests/src/pcm_in_test.cc
+++ b/tests/src/pcm_in_test.cc
@@ -73,6 +73,7 @@ class PcmInTest : public ::testing::Test {
};
TEST_F(PcmInTest, GetDelay) {
+ pcm_prepare(pcm_object);
long delay = pcm_get_delay(pcm_object);
std::cout << delay << std::endl;
ASSERT_GE(delay, 0);
diff --git a/tests/src/pcm_out_test.cc b/tests/src/pcm_out_test.cc
index cbc6983..f8d4345 100644
--- a/tests/src/pcm_out_test.cc
+++ b/tests/src/pcm_out_test.cc
@@ -192,13 +192,13 @@ TEST_F(PcmOutMmapTest, Write) {
buffer[i] = static_cast<char>(i);
}
- int written_frames = 0;
+ int res = 0;
unsigned int frames = pcm_bytes_to_frames(pcm_object, buffer_size);
pcm_start(pcm_object);
auto start = std::chrono::steady_clock::now();
for (uint32_t i = 0; i < write_count; ++i) {
- written_frames = pcm_mmap_write(pcm_object, buffer.get(), buffer_size);
- ASSERT_EQ(written_frames, frames);
+ res = pcm_mmap_write(pcm_object, buffer.get(), buffer_size);
+ ASSERT_EQ(res, 0);
}
pcm_stop(pcm_object);