1 /*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
4 for INTEL64(R), AMD64(R)
6 Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
11 1. Redistributions of source code must retain the above copyright notice,
12 this list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
17 THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
18 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 OF THE POSSIBILITY OF SUCH DAMAGE.
29 DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
31 /* File Info -----------------------------------------------------------
35 ----------------------------------------------------------------------*/
37 #define DRD64_SRC_TEST_LIBGOBLIN_PROGINFO
38 #include"drd64_libgoblin.h"
39 #include"test_libgoblin.h"
42 /* ProgInfo_AllocProgInfo() & FreeProgInfo() *******************/
43 /*--------------------------------------------------------------------*/
44 void Test_ProgInfo_AllocFree_test00_001( void )
49 i_result = LibBrownie_Init();
50 CU_ASSERT( 0x00 == i_result );
52 i_result = ProgInfo_Init();
53 CU_ASSERT( 0x00 == i_result );
55 i_bid = LibGoblin_AllocProgInfo();
56 CU_ASSERT( 0x00 == i_bid );
58 i_result = LibGoblin_FreeProgInfo( i_bid );
59 CU_ASSERT( 0x00 == i_result );
61 i_result = ProgInfo_Term();
62 CU_ASSERT( 0x00 == i_result );
70 /*--------------------------------------------------------------------*/
71 void Test_ProgInfo_AllocFree_test00_002( void )
77 i_result = LibBrownie_Init();
78 CU_ASSERT( 0x00 == i_result );
80 i_result = ProgInfo_Init();
81 CU_ASSERT( 0x00 == i_result );
83 for( i_cnt = 0; i_cnt < 33; i_cnt++ ) {
84 i_bid = LibGoblin_AllocProgInfo();
85 CU_ASSERT( i_cnt == i_bid );
88 for( i_cnt = 0; i_cnt < 8; i_cnt++ ) {
89 i_result = LibGoblin_FreeProgInfo( i_cnt );
90 CU_ASSERT( 0x00 == i_result );
93 for( i_cnt = 0; i_cnt < 8; i_cnt++ ) {
94 i_bid = LibGoblin_AllocProgInfo();
95 CU_ASSERT( i_cnt == i_bid );
98 for( i_cnt = 0; i_cnt < 33; i_cnt++ ) {
99 i_result = LibGoblin_FreeProgInfo( i_cnt );
100 CU_ASSERT( 0x00 == i_result );
103 i_result = LibGoblin_FreeProgInfo( i_cnt );
104 CU_ASSERT( 0x00 > i_result );
106 i_result = LibGoblin_FreeProgInfo( 0 );
107 CU_ASSERT( 0x00 > i_result );
109 i_result = ProgInfo_Term();
110 CU_ASSERT( 0x00 == i_result );
118 /* ProgInfo_Init() & Term() **********************************/
119 /*--------------------------------------------------------------------*/
120 void Test_ProgInfo_InitTerm_test00_001( void )
124 i_result = LibBrownie_Init();
125 CU_ASSERT( 0x00 == i_result );
127 i_result = ProgInfo_Init();
128 CU_ASSERT( 0x00 == i_result );
130 i_result = ProgInfo_Term();
131 CU_ASSERT( 0x00 == i_result );
139 /*----------------------------------------------------------------------
140 ----------------------------------------------------------------------*/
141 DRD64_TEST_LIBGOBLIN_PROGINFO_EXTERN
143 Test_LibGoblin_ProgInfo(
148 pt_goblin = CU_add_suite( "ProgramInfo", NULL, NULL );
150 CU_add_test( pt_goblin, "ProgInfo_InitTerm_test00_001",
151 Test_ProgInfo_InitTerm_test00_001 );
152 CU_add_test( pt_goblin, "ProgInfo_AllocFree_test00_001",
153 Test_ProgInfo_AllocFree_test00_001 );
154 CU_add_test( pt_goblin, "ProgInfo_AllocFree_test00_002",
155 Test_ProgInfo_AllocFree_test00_002 );
162 /* EOF of drd64_.c ----------------------------------- */