增加FQDN_plugin返回结果顺序的测试用例。
This commit is contained in:
@@ -325,6 +325,7 @@ int Maat_fqdn_plugin_EX_register(Maat_feather_t feather, int table_id,
|
|||||||
Maat_plugin_EX_dup_func_t* dup_func,
|
Maat_plugin_EX_dup_func_t* dup_func,
|
||||||
long argl, void *argp);
|
long argl, void *argp);
|
||||||
|
|
||||||
|
//Return order: Longger suffix first, then fqdn with bigger index first.
|
||||||
int Maat_fqdn_plugin_get_EX_data(Maat_feather_t feather, int table_id, const char* fqdn, MAAT_PLUGIN_EX_DATA* ex_data_array, size_t n_ex_data);
|
int Maat_fqdn_plugin_get_EX_data(Maat_feather_t feather, int table_id, const char* fqdn, MAAT_PLUGIN_EX_DATA* ex_data_array, size_t n_ex_data);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -380,6 +380,8 @@ TEST(FQDN_Plugin_Table, EX_DATA)
|
|||||||
|
|
||||||
ret=Maat_fqdn_plugin_get_EX_data(g_feather, table_id, "r3---sn-i3belne6.example2.com", (void**)result, 4);
|
ret=Maat_fqdn_plugin_get_EX_data(g_feather, table_id, "r3---sn-i3belne6.example2.com", (void**)result, 4);
|
||||||
ASSERT_EQ(ret, 2);
|
ASSERT_EQ(ret, 2);
|
||||||
|
EXPECT_EQ(result[0]->rule_id, 205);
|
||||||
|
EXPECT_EQ(result[1]->rule_id, 204);
|
||||||
for(i=0; i<ret; i++)
|
for(i=0; i<ret; i++)
|
||||||
{
|
{
|
||||||
fqdn_plugin_EX_free_cb(0, (void**)&(result[i]), 0, NULL);
|
fqdn_plugin_EX_free_cb(0, (void**)&(result[i]), 0, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user