int sample_test_codes_4() { /** Step 1. Initialize the framework */ if (rcu_init() == RCU_E_NG) { return(-1); } /** Step 2. Register a test module table */ if ((rcu_add_test_mod_tbl(RCU_DEFAULT_REGISTRY,sample_test_mod_tbl)) == RCU_E_NG) { rcu_destroy(); return(-1); } /** Optionally,dump the test database */ rcu_dump_test_dbase(); /** Step 3. Run the test machine */ rcu_run_test_mach(); /** Step 4. Destroy the framework */ rcu_destroy(); return(0); }
RCU_DEF_MOD_TBL_END TMK_TEST(rcu_test_add_mod_tbl) { TMK_ASSERT_EQUAL(RCU_E_OK, rcu_add_test_mod_tbl(rcu_get_default_reg(), mod_tbl)); TMK_ASSERT(rcu_destroy() == RCU_E_OK); }
RCU_DEF_MOD_TBL_END TMK_TEST(rcu_test_mod_on_null_reg) { TMK_ASSERT_EQUAL(RCU_E_OK, rcu_add_test_mod_tbl(NULL, rcu_test_mod_017_mtbl1)); }