alsa_api_test: Add snd_pcm_rewind case for move test

When hw_ptr is wrapped around boundary and becomes less than appl_ptr,
we need to use snd_pcm_rewind to rewind appl_ptr to fuzz ahead of
hw_ptr. Since boundary is a very large value and it requires a long time
for hw_ptr to be wrapped, we test this case by moving appl_ptr when
appl_ptr is still ahead of hw_ptr.

Also, fix the type for frames and log format for frames to use %ld for frames
because on 64-bit platform int is not large enough for snd_pcm_sframes_t.

BUG=chromium:519942
TEST=run `alsa_api_test --device hw:1,0 --move` on samus
TEST=run the same test on samus with hacked kernel where boundary is
small.

Change-Id: I4d024cf5fb273773b6c82c666e021ab03078126c
Reviewed-on: https://chromium-review.googlesource.com/344871
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
1 file changed