if( -0x01 == PGINFO( i_cnt )->i_id ) {
p_pginfo = PGINFO( i_cnt );
i_id_now = i_cnt;
- gi_now_program_info++;
- goto goto_LibGoblin_ProgInfo_AllocProgInfo_post;
+ goto goto_LibGoblin_ProgInfo_AllocProgInfo_dataset;
}
}
+
+ goto goto_LibGoblin_ProgInfo_AllocProgInfo_post;
}
if( gi_now_program_info == gi_alloc_program_info ) {
sizeof( LibGoblin_ProgramInfo ) *
( gi_alloc_program_info + LIBGOBLIN_PROGINFO_UNITS ) );
if( NULL == p_pgbase ) {
- goto goto_LibGoblin_ProgInfo_AllocProgInfo_post;
+ goto goto_LibGoblin_ProgInfo_AllocProgInfo_post;
}
gp_program_info = p_pgbase;
gi_alloc_program_info += LIBGOBLIN_PROGINFO_UNITS;
-
}
- p_pginfo = PGINFO( gi_now_program_info );
- i_id_now = gi_now_program_info++;
+ i_id_now = gi_now_program_info;
+goto_LibGoblin_ProgInfo_AllocProgInfo_dataset:
if( i_id_now == gi_max_program_info ) { gi_max_program_info++; }
+ p_pginfo = PGINFO( i_id_now );
+ p_pginfo->i_id = i_id_now;
+ gi_now_program_info++;
goto_LibGoblin_ProgInfo_AllocProgInfo_post:
return p_pginfo;
if( NULL == p_pginfo ) {
return -0x01;
}
+ assert( p_pginfo->i_id == i_pgid );
i_result = LibGoblin_ProgInfo_FreeProgInfo( p_pginfo );
if( 0x00 != i_result ) {
}
i_result = LibGoblin_FreeProgInfo( i_cnt );
- CU_ASSERT( 0x00 != i_result );
+ CU_ASSERT( 0x00 > i_result );
i_result = LibGoblin_FreeProgInfo( 0 );
- CU_ASSERT( 0x00 != i_result );
+ CU_ASSERT( 0x00 > i_result );
i_result = LibGoblin_ProgInfo_Term();
CU_ASSERT( 0x00 == i_result );