END_TEST START_TEST(test_dynamic_type) { qeocore_type_t *structure = NULL, *sequence = NULL, *string = NULL, *primitive = NULL; qeocore_member_id_t id; /* init */ stub_init(); /* test */ fail_unless(NULL != (structure = qeocore_type_struct_new("a_dynamic_struct"))); fail_unless(NULL != (string = qeocore_type_string_new(0))); fail_unless(NULL != (primitive = qeocore_type_primitive_new(QEOCORE_TYPECODE_INT32))); fail_unless(NULL != (sequence = qeocore_type_sequence_new(primitive))); qeocore_type_free(primitive); id = QEOCORE_MEMBER_ID_DEFAULT; fail_unless(QEO_OK == qeocore_type_struct_add(structure, string, "a_string", &id, QEOCORE_FLAG_KEY)); qeocore_type_free(string); id = QEOCORE_MEMBER_ID_DEFAULT; fail_unless(QEO_OK == qeocore_type_struct_add(structure, sequence, "a_sequence", &id, QEOCORE_FLAG_NONE)); qeocore_type_free(sequence); /* clean up */ qeocore_type_free(structure); stub_fini(); }
void intr_init(void) { idt_init(); stub_init(); isr_int(); init_8259A(); enable_intr(); }
END_TEST START_TEST(test_cache_refcnt) { qeocore_type_t *ti1, *ti2; /* init */ stub_init(); core_register_type_IgnoreAndReturn(QEO_OK); core_unregister_type_IgnoreAndReturn(QEO_OK); /* test */ ti1 = qeocore_type_register_tsm(_factory, _tsm_simple, "simple"); fail_unless(NULL != ti1); ti2 = qeocore_type_register_tsm(_factory, _tsm_simple, "simple"); fail_unless(ti1->u.tsm_based.ts == ti2->u.tsm_based.ts); /* fini */ qeocore_type_free(ti1); qeocore_type_free(ti2); stub_fini(); }