test: add platon test case test_005ParametersSet_0005SetValueFailureNullTx
fix the issue
teambition task id
@@ -371,6 +371,34 @@ START_TEST(test_005ParametersSet_0004SetValueSuccess)
}
END_TEST
+START_TEST(test_005ParametersSet_0005SetValueFailureNullTx)
+{
+ BSINT32 rtnVal;
+ BoatPlatONTx tx_ptr;
+
+ BoatIotSdkInit();
+
+ rtnVal = platonWalletPrepare();
+ ck_assert_int_eq(rtnVal, BOAT_SUCCESS);
+
+ ck_assert_int_eq(strlen(TEST_RECIPIENT_ADDRESS), 42);
+
+ rtnVal = BoatPlatONTxInit(g_platon_wallet_ptr, &tx_ptr, TEST_IS_SYNC_TX, TEST_GAS_PRICE,
+ TEST_GAS_LIMIT, TEST_RECIPIENT_ADDRESS, hrp);
+ ck_assert(rtnVal == BOAT_SUCCESS);
+
+
+
+ BoatFieldMax32B value;
+ value.field_len = UtilityHexToBin(value.field, 32, "0x2386F26FC10000",
+ TRIMBIN_LEFTTRIM, BOAT_TRUE);
+ rtnVal = BoatPlatONTxSetValue(NULL, &value);
+ ck_assert(rtnVal == BOAT_ERROR_COMMON_INVALID_ARGUMENT);
+
+ BoatIotSdkDeInit();
+}
+END_TEST
+
Suite *make_parameters_suite(void)
{
/* Create Suite */
@@ -401,6 +429,7 @@ Suite *make_parameters_suite(void)
tcase_add_test(tc_param_api, test_005ParametersSet_0002SetNonceSuccess);
tcase_add_test(tc_param_api, test_005ParametersSet_0003SetNonceFailureNullTx);
tcase_add_test(tc_param_api, test_005ParametersSet_0004SetValueSuccess);
+ tcase_add_test(tc_param_api, test_005ParametersSet_0005SetValueFailureNullTx);
return s_param;
}
\ No newline at end of file
