/[hurd]/hurd-l4/libl4/tests/t-l4-message.c
ViewVC logotype

Diff of /hurd-l4/libl4/tests/t-l4-message.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by marcus, Tue Feb 15 18:27:45 2005 UTC revision 1.2 by marcus, Fri Feb 18 03:58:08 2005 UTC
# Line 1  Line 1 
1  /* t-vregs.c - A test for the interfaces to the L4 message registers.  /* t-message.c - A test for the interfaces to the L4 message registers.
2     Copyright (C) 2005 Free Software Foundation, Inc.     Copyright (C) 2005 Free Software Foundation, Inc.
3     Written by Matthieu Lemerre <racin@free.fr> and     Written by Matthieu Lemerre <racin@free.fr> and
4     Marcus Brinkmann <marcus@gnu.org>.     Marcus Brinkmann <marcus@gnu.org>.
# Line 35  Line 35 
35  #include <l4/message.h>  #include <l4/message.h>
36    
37    
38    #define L4_NUM_MRS_OK 64
39    #define L4_NUM_BRS_OK 33
40    
41    
42  /* Test the message register MR with value VAL_OK.  */  /* Test the message register MR with value VAL_OK.  */
43  void  void
44  test_one_mr (int mr, _L4_word_t val_ok)  test_one_mr (int mr, word_t val_ok)
45  {  {
46    #ifdef _L4_INTERFACE_INTERN
47    {    {
48      _L4_word_t val;      _L4_word_t val;
49      char *msg;      char *msg;
# Line 53  test_one_mr (int mr, _L4_word_t val_ok) Line 58  test_one_mr (int mr, _L4_word_t val_ok)
58      _L4_store_mr (mr, &val);      _L4_store_mr (mr, &val);
59      check_nr ("[intern]", msg, val, val_ok);      check_nr ("[intern]", msg, val, val_ok);
60    }    }
61    #endif
62    
63  #ifdef _L4_INTERFACE_GNU  #ifdef _L4_INTERFACE_GNU
64    {    {
# Line 95  test_one_mr (int mr, _L4_word_t val_ok) Line 101  test_one_mr (int mr, _L4_word_t val_ok)
101  void  void
102  test_many_mrs (int start_mr, int nr, _L4_word_t *values_ok)  test_many_mrs (int start_mr, int nr, _L4_word_t *values_ok)
103  {  {
104    #ifdef _L4_INTERFACE_INTERN
105    {    {
106      _L4_word_t values[nr];      _L4_word_t values[nr];
107      int i;      int i;
# Line 117  test_many_mrs (int start_mr, int nr, _L4 Line 124  test_many_mrs (int start_mr, int nr, _L4
124          check_nr ("[intern]", msg, values[i], values_ok[i]);          check_nr ("[intern]", msg, values[i], values_ok[i]);
125        }        }
126    }    }
127    #endif
128    
129  #ifdef _L4_INTERFACE_GNU  #ifdef _L4_INTERFACE_GNU
130    {    {
# Line 177  test_mrs (void) Line 185  test_mrs (void)
185    {    {
186      int start_mr;      int start_mr;
187      int nr;      int nr;
188      _L4_word_t values[L4_NUM_MRS];      word_t values[L4_NUM_MRS_OK];
189    } tests[] =    } tests[] =
190      {      {
191        {  0, 1, { 22 } },        {  0, 1, { 22 } },
# Line 195  test_mrs (void) Line 203  test_mrs (void)
203    int nr = sizeof (tests) / sizeof (tests[0]);    int nr = sizeof (tests) / sizeof (tests[0]);
204    int i;    int i;
205    
206    check_nr ("[intern]", "_L4_NUM_MRS", _L4_NUM_MRS, 64);  #ifdef _L4_INTERFACE_INTERN
207      check_nr ("[intern]", "_L4_NUM_MRS", _L4_NUM_MRS, L4_NUM_MRS_OK);
208    #endif
209  #ifdef _L4_INTERFACE_GNU  #ifdef _L4_INTERFACE_GNU
210    check_nr ("[GNU]", "L4_NUM_MRS", L4_NUM_MRS, 64);    check_nr ("[GNU]", "L4_NUM_MRS", L4_NUM_MRS, L4_NUM_MRS_OK);
211  #endif  #endif
212    /* FIXME: There is no L4 interface for this.  */    /* FIXME: There is no L4 interface for this.  */
213    
# Line 213  test_mrs (void) Line 223  test_mrs (void)
223  void  void
224  test_one_br (int br, _L4_word_t val_ok)  test_one_br (int br, _L4_word_t val_ok)
225  {  {
226    #ifdef _L4_INTERFACE_INTERN
227    {    {
228      _L4_word_t val;      _L4_word_t val;
229      char *msg;      char *msg;
# Line 227  test_one_br (int br, _L4_word_t val_ok) Line 238  test_one_br (int br, _L4_word_t val_ok)
238      _L4_store_br (br, &val);      _L4_store_br (br, &val);
239      check_nr ("[intern]", msg, val, val_ok);      check_nr ("[intern]", msg, val, val_ok);
240    }    }
241    #endif
242    
243  #ifdef _L4_INTERFACE_GNU  #ifdef _L4_INTERFACE_GNU
244    {    {
# Line 269  test_one_br (int br, _L4_word_t val_ok) Line 281  test_one_br (int br, _L4_word_t val_ok)
281  void  void
282  test_many_brs (int start_br, int nr, _L4_word_t *values_ok)  test_many_brs (int start_br, int nr, _L4_word_t *values_ok)
283  {  {
284    #ifdef _L4_INTERFACE_INTERN
285    {    {
286      _L4_word_t values[nr];      _L4_word_t values[nr];
287      int i;      int i;
# Line 291  test_many_brs (int start_br, int nr, _L4 Line 304  test_many_brs (int start_br, int nr, _L4
304          check_nr ("[intern]", msg, values[i], values_ok[i]);          check_nr ("[intern]", msg, values[i], values_ok[i]);
305        }        }
306    }    }
307    #endif
308    
309  #ifdef _L4_INTERFACE_GNU  #ifdef _L4_INTERFACE_GNU
310    {    {
# Line 351  test_brs (void) Line 365  test_brs (void)
365    {    {
366      int start_br;      int start_br;
367      int nr;      int nr;
368      _L4_word_t values[L4_NUM_BRS];      word_t values[L4_NUM_BRS_OK];
369    } tests[] =    } tests[] =
370      {      {
371        {  0, 1, { 24 } },        {  0, 1, { 24 } },
# Line 366  test_brs (void) Line 380  test_brs (void)
380    int nr = sizeof (tests) / sizeof (tests[0]);    int nr = sizeof (tests) / sizeof (tests[0]);
381    int i;    int i;
382    
383    check_nr ("[intern]", "_L4_NUM_BRS", _L4_NUM_BRS, 33);  #ifdef _L4_INTERFACE_INTERN
384      check_nr ("[intern]", "_L4_NUM_BRS", _L4_NUM_BRS, L4_NUM_BRS_OK);
385    #endif
386  #ifdef _L4_INTERFACE_GNU  #ifdef _L4_INTERFACE_GNU
387    check_nr ("[GNU]", "L4_NUM_BRS", L4_NUM_BRS, 33);    check_nr ("[GNU]", "L4_NUM_BRS", L4_NUM_BRS, L4_NUM_BRS_OK);
388  #endif  #endif
389    /* FIXME: There is no L4 interface for this.  */    /* FIXME: There is no L4 interface for this.  */
390    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26