LibGoblin_ObjectInfo *p_objinfo;
LibGoblin_ObjectInfo *p_objmaster;
+ // Scenery 1 ......................................................
+ // Alloc ---
+ qw_addr = 0x0000000000000000;
+ p_objinfo = ObjectInfo_InsetObject( p_pginfo, qw_addr, 0x10000000, NULL, 0x00 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, 1, 0, NO_OBJ, NO_OBJ, NO_OBJ );
+
+ qw_addr += 0x00100000;
+
+ for( i_cnt = 2; i_cnt < 10000; i_cnt++ ) {
+ p_objinfo = ObjectInfo_InsetObject( p_pginfo, qw_addr, 0x10000000, NULL, 0x00 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, i_cnt, 0, NO_OBJ, i_cnt - 1, NO_OBJ );
+
+ qw_addr += 0x00000100;
+ }
+
+ // Check ---
+ p_objmaster = OBJINFO( p_pginfo, 0 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objmaster, 0, NO_OBJ, 1, NO_OBJ, NO_OBJ );
+
+ // Delete ---
+ for( i_cnt = 1; i_cnt < 9999; i_cnt++ ) {
+ p_objinfo = OBJINFO( p_pginfo, i_cnt );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, i_cnt, 0, NO_OBJ, NO_OBJ, (i_cnt + 1) );
+
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( (i_cnt + 1) == p_objmaster->grplink.i_child_topid );
+ }
+
+ p_objinfo = OBJINFO( p_pginfo, i_cnt );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, i_cnt, 0, NO_OBJ, NO_OBJ, NO_OBJ );
+
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( NO_OBJ == p_objmaster->grplink.i_child_topid );
+ CU_ASSERT( NO_OBJ == p_objmaster->addrlink.i_next_id );
+
+ // Scenery 2 ......................................................
+ // Alloc ---
+ qw_size = 0x0000000000000001;
+ p_objinfo = ObjectInfo_InsetObject( p_pginfo, 0x1000000000000000, qw_size, NULL, 0x00 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, 1, 0, NO_OBJ, NO_OBJ, NO_OBJ );
+
+ for( i_cnt = 2; i_cnt < 10; i_cnt++ ) {
+ qw_size <<= 1;
+ p_objinfo = ObjectInfo_InsetObject( p_pginfo, 0x1000000000000000, qw_size, NULL, 0x00 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, i_cnt, 0, NO_OBJ, NO_OBJ, i_cnt - 1 );
+ }
+
+ // Check ---
+ p_objmaster = OBJINFO( p_pginfo, 0 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objmaster, 0, NO_OBJ, 9, NO_OBJ, NO_OBJ );
+
+ // Delete ---
+ for( i_cnt = 9; i_cnt > 1; i_cnt-- ) {
+ p_objinfo = OBJINFO( p_pginfo, i_cnt );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, i_cnt, 0, NO_OBJ, NO_OBJ, (i_cnt - 1) );
+
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( (i_cnt - 1) == p_objmaster->grplink.i_child_topid );
+ }
+
+ p_objinfo = OBJINFO( p_pginfo, 1 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, 1, 0, NO_OBJ, NO_OBJ, NO_OBJ );
+
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( NO_OBJ == p_objmaster->grplink.i_child_topid );
+
+ // Scenery 3 ......................................................
+ // Alloc ---
+ qw_addr = 0x10000000;
+ p_objinfo = ObjectInfo_InsetObject( p_pginfo, qw_addr, 0x20000000, NULL, 0x00 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, 1, 0, NO_OBJ, NO_OBJ, NO_OBJ );
+
+ for( i_cnt = 2; i_cnt < 10; i_cnt++ ) {
+ qw_addr += 0x10000000;
+ p_objinfo = ObjectInfo_InsetObject( p_pginfo, qw_addr, 0x20000000, NULL, 0x00 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, i_cnt, 0, NO_OBJ, (i_cnt - 1), NO_OBJ );
+ }
+
+ // Check ---
+ p_objmaster = OBJINFO( p_pginfo, 0 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objmaster, 0, NO_OBJ, 1, NO_OBJ, NO_OBJ );
+
+ // Delete ---
+ for( i_cnt = 0; i_cnt < 7; i_cnt++ ) {
+ p_objinfo = OBJINFO( p_pginfo, (2 + i_cnt) );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, (2 + i_cnt), 0, NO_OBJ, 1, (3 + i_cnt) );
+
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( 1 == p_objmaster->grplink.i_child_topid );
+ }
+
+ p_objinfo = OBJINFO( p_pginfo, 1 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, 1, 0, NO_OBJ, NO_OBJ, 9 );
+
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( 9 == p_objmaster->grplink.i_child_topid );
+
+ p_objinfo = OBJINFO( p_pginfo, 9 );
+ Test_ObjectInfo_CUAssert_GrpLink( p_objinfo, 9, 0, NO_OBJ, NO_OBJ, NO_OBJ );
+
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( NO_OBJ == p_objmaster->grplink.i_child_topid );
+
+ // Delete MasterObject
+ p_objinfo = OBJINFO( p_pginfo, 0 );
+ ObjectInfo_DeleteObjectInfo( p_pginfo, p_objinfo, 0x00 );
+ CU_ASSERT( NO_OBJ == p_pginfo->objinfo.i_topid );
+
+ return;
+}
+
+/*--------------------------------------------------------------------*/
+void Test_ObjectInfo_InsetDelete_test00_003(
+ LibGoblin_ProgramInfo *p_pginfo )
+{
+ int i_cnt;
+ QWord qw_addr;
+ QWord qw_size;
+ LibGoblin_ObjectInfo *p_objinfo;
+ LibGoblin_ObjectInfo *p_objmaster;
+
// Scenery 1
// Alloc ---
qw_addr = 0x0000000000000000;
// Alloc Test ---
Test_ObjectInfo_InsetDelete_test00_001( p_pginfo );
Test_ObjectInfo_InsetDelete_test00_002( p_pginfo );
+ Test_ObjectInfo_InsetDelete_test00_003( p_pginfo );
// Term ---
i_result = ObjectInfo_Term( p_pginfo );