feat(fabric test case):
add fabric test case "GetWalletByIndex_Index_ERR"
@@ -703,6 +703,23 @@ START_TEST(test_001CreateWallet_0015GetWalletByIndex_Success)
}
END_TEST
+START_TEST(test_001CreateWallet_0016GetWalletByIndex_Index_ERR)
+{
+ BSINT32 rtnVal;
+ BoatHlfabricWallet *g_fabric_wallet_ptr = NULL;
+ BoatHlfabricWalletConfig wallet_config = get_fabric_wallet_settings();
+ /* 1. execute unit test */
+ rtnVal = BoatWalletCreate(BOAT_PROTOCOL_HLFABRIC, NULL, &wallet_config, sizeof(BoatHlfabricWalletConfig));
+
+
+ ck_assert_int_eq(rtnVal, 0);
+ ck_assert(g_boat_iot_sdk_context.wallet_list[0].is_used == true);
+ g_fabric_wallet_ptr = BoatGetWalletByIndex(1);
+ ck_assert(g_fabric_wallet_ptr == NULL);
+ fabricWalletConfigFree(wallet_config);
+}
+END_TEST
+
Suite *make_wallet_suite(void)
{
@@ -730,6 +747,7 @@ Suite *make_wallet_suite(void)
tcase_add_test(tc_wallet_api, test_001CreateWallet_0013CreatePersistWalletFail_11wallets);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0014CreatePersistWalletFail_KeyTypeErr);
tcase_add_test(tc_wallet_api, test_001CreateWallet_0015GetWalletByIndex_Success);
+ tcase_add_test(tc_wallet_api, test_001CreateWallet_0016GetWalletByIndex_Index_ERR);
return s_wallet;
}
