[lsb-discuss] first attempt at "normal" t2c-alsa test

Andrey Ponomarenko susanin at ispras.ru
Wed Apr 21 22:52:23 PDT 2010


On 04/22/2010 12:23 AM, Stew Benedict wrote:
> I've attached modifications to test snd_pcm_open, following Alexey's
> tutorial as best I could. Please review and comment. I'm still having
> some trouble wrapping my head around things.
>
> Questions in my mind:
>
> 1) seems like I should have a snd_pcm_close() in there somewhere, but I
> either ended up with segfaults or child exiting with signal 6 when I
> tried to add it to the test
> 2) the -1 in the sequence was intended to give me a <0 result to test
> req-06.02, but it didn't really happen. I'm not sure how to force the
> error condition
>
>   

Hello,
I've tried to run the same test on my work station (ALSA v1.0.22):

------------------code----------------------
#include <alsa/asoundlib.h>
int main(int argc, char *argv[ ])
{
    snd_pcm_t* pcm = 0;
    int res = snd_pcm_open(
        (snd_pcm_t**)&pcm,
        "hw:0",
        -1,
        SND_PCM_NONBLOCK); //target call
    printf("res=%d\n", res);
    return 0;
}
------------------/code----------------------

And it reports:

ALSA lib pcm_hw.c:1268:(snd_pcm_hw_open) invalid stream -1
res=-22

Also I have run test for snd_pcm_close:

------------------code----------------------
#include <alsa/asoundlib.h>
int main(int argc, char *argv[ ])
{
    snd_pcm_t* pcm = 0;
    snd_pcm_open(
        (snd_pcm_t**)&pcm,
        "hw:0",
        SND_PCM_STREAM_PLAYBACK,
        SND_PCM_NONBLOCK); //target call
   
    int res = snd_pcm_close(pcm);
    printf("res=%d\n", res);
    return 0;
}
------------------/code----------------------

And it reports:
res=0

So snd_pcm_close and snd_pcm_open work as expected at least on my station.

The signal 6 (ABRT) your received possibly means that your pcm is NULL
(passed to snd_pcm_close and then aborted). Try to check it before
passing to snd_pcm_close (standalone test without both tet and t2c):

------------------code----------------------
#include <alsa/asoundlib.h>
int main(int argc, char *argv[ ])
{
    snd_pcm_t* pcm = 0;
    snd_pcm_open(
        (snd_pcm_t**)&pcm,
        "hw:0",
        SND_PCM_STREAM_PLAYBACK,
        SND_PCM_NONBLOCK); //target call
    printf("pcm=%d\n", (int)pcm);
    snd_pcm_close(pcm);
    return 0;
}
------------------/code----------------------

> 200|15 17 16:01:16|TP Start
> 520|15 17 00015442 1 1|Test target(s):
> 520|15 17 00015442 1 2|snd_pcm_open
> 520|15 17 00015442 1 3|--------
> 520|15 17 00015442 1 4|Checked requirement: {snd_pcm_open.06.01}
> 220|15 17 0 16:01:16|PASS
> 410|15 17 1 16:01:16|IC End
> 400|15 18 1 16:01:16|IC Start
> 200|15 18 16:01:16|TP Start
> 520|15 18 00015443 1 1|Test target(s):
> 520|15 18 00015443 1 2|snd_pcm_open
> 520|15 18 00015443 1 3|--------
> 520|15 18 00015443 1 4|Checked requirement: {snd_pcm_open.06.01}
> 220|15 18 0 16:01:16|PASS
> 410|15 18 1 16:01:16|IC End
> 400|15 19 1 16:01:16|IC Start
> 200|15 19 16:01:16|TP Start
> 520|15 19 00015444 1 1|Test target(s):
> 520|15 19 00015444 1 2|snd_pcm_open
> 520|15 19 00015444 1 3|--------
> 520|15 19 00015444 1 4|Checked requirement: {snd_pcm_open.06.01}
> 220|15 19 0 16:01:16|PASS
> 410|15 19 1 16:01:16|IC End
>
> Finally, I'm having a hard time understanding the relationship between
> the marked up specs and the tests. I sort of expected these requirements
> to get populated with meaningful info in the test journal, but even with
> Alexey's example, we just get interface.xx, which one would have to go
> back to the marked up spec to find out what requirement is being tested,
> and why things are failing.
>
> I'm thinking that it's due to the way things are currently setup, with
> tests being in files named differently than the marked up spec, but
> maybe my expectations are just wrong. I'm not seeing how the tests are
> tied to the marked up spec, aside from the copy/paste operations to the
> req(s) into the test.
>
> Example(s):
>
> snd_card_next:
> spec: group_control.html
> catalog generated from spec: group_control.xml
> test_code: ALSA_Control_Interface.t2c
> catalog corresponding to test code: ALSA_Control_Interface.xml
>
> snd_pcm_open:
> spec: group___p_c_m.html
> catalog generated from spec: group___p_c_m.xml
> test code: ALSA_PCM_Interface_General_Functions.t2c
> catalog corresponding to test code: ALSA_PCM_Interface_General_Functions.xml
>
>   
>
>
> _______________________________________________
> lsb-discuss mailing list
> lsb-discuss at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/lsb-discuss
>   


-- 
Andrey Ponomarenko

Linux Verification Center, ISPRAS
 web:    http://www.linuxtesting.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux-foundation.org/pipermail/lsb-discuss/attachments/20100422/da4a4f37/attachment.htm 


More information about the lsb-discuss mailing list