|
0
|
1 //========================================================================== |
|
|
2 // |
|
|
3 // mutex0.cxx |
|
|
4 // |
|
|
5 // Mutex and condition variable test 0 |
|
|
6 // |
|
|
7 //========================================================================== |
|
|
8 //####COPYRIGHTBEGIN#### |
|
|
9 // |
|
|
10 // ------------------------------------------- |
|
|
11 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
12 // Version 1.0 (the "License"); you may not use this file except in |
|
|
13 // compliance with the License. You may obtain a copy of the License at |
|
|
14 // http://sourceware.cygnus.com/ecos |
|
|
15 // |
|
|
16 // Software distributed under the License is distributed on an "AS IS" |
|
|
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
18 // License for the specific language governing rights and limitations under |
|
|
19 // the License. |
|
|
20 // |
|
|
21 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
22 // September 30, 1998. |
|
|
23 // |
|
|
24 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
26 // ------------------------------------------- |
|
|
27 // |
|
|
28 //####COPYRIGHTEND#### |
|
|
29 //========================================================================== |
|
|
30 //#####DESCRIPTIONBEGIN#### |
|
|
31 // |
|
|
32 // Author(s): dsm |
|
|
33 // Contributors: dsm |
|
|
34 // Date: 1998-02-24 |
|
|
35 // Description: Limited to checking constructors/destructors |
|
|
36 //####DESCRIPTIONEND#### |
|
|
37 |
|
|
38 #include <pkgconf/kernel.h> |
|
|
39 |
|
|
40 #include <cyg/kernel/mutex.hxx> |
|
|
41 |
|
|
42 #include <cyg/infra/testcase.h> |
|
|
43 |
|
|
44 #include "testaux.hxx" |
|
|
45 |
|
|
46 static Cyg_Mutex mutex0; |
|
|
47 |
|
|
48 static Cyg_Condition_Variable cvar0( mutex0 ); |
|
|
49 |
|
|
50 static bool flash( void ) |
|
|
51 { |
|
|
52 Cyg_Mutex m0; |
|
|
53 |
|
|
54 CYG_ASSERTCLASSO(m0, "error"); |
|
|
55 |
|
|
56 Cyg_Condition_Variable cv0( m0 ); |
|
|
57 |
|
|
58 CYG_ASSERTCLASSO(cv0, "error"); |
|
|
59 |
|
|
60 return true; |
|
|
61 } |
|
|
62 |
|
|
63 void mutex0_main( void ) |
|
|
64 { |
|
|
65 CYG_TEST_INIT(); |
|
|
66 |
|
|
67 CHECK(flash()); |
|
|
68 CHECK(flash()); |
|
|
69 |
|
|
70 CYG_ASSERTCLASSO(mutex0, "error"); |
|
|
71 CYG_ASSERTCLASSO(cvar0, "error"); |
|
|
72 |
|
|
73 CYG_TEST_PASS_FINISH("Mutex 0 OK"); |
|
|
74 |
|
|
75 } |
|
|
76 |
|
|
77 externC void |
|
|
78 cyg_start( void ) |
|
|
79 { |
|
|
80 mutex0_main(); |
|
|
81 } |
|
|
82 // EOF mutex0.cxx |