WVPASS(fres_contract_get_budget(&c, &budget));
WVPASS(fosa_rel_time_to_msec(budget) == b[i]);
}
-}
-WVTEST_MAIN("renegotiation")
-{
+ /* Renegotiate the first two contracts */
for (i=0; i<2; i++) {
budget = fosa_msec_to_rel_time(2*b[i]);
period = fosa_msec_to_rel_time(110);
WVPASS(fosa_rel_time_to_msec(budget) == 2*b[i]);
}
+ /* Try to renegotiate the third contract - it will be rejected */
budget = fosa_msec_to_rel_time(2*b[2]);
period = fosa_msec_to_rel_time(110);
ret = WVFRSH(frsh_contract_set_basic_params(&contract[2],
FRSH_CT_REGULAR));
WVPASS(frsh_contract_renegotiate_sync(&contract[2], vres[2]) == FRSH_ERR_CONTRACT_REJECTED);
- WVFRSH(frsh_vres_get_contract(vres[i], &c));
+ WVFRSH(frsh_vres_get_contract(vres[2], &c));
WVPASS(fres_contract_get_budget(&c, &budget));
- WVPASS(fosa_rel_time_to_msec(budget) == b[i]);
-}
+ WVPASSEQ(fosa_rel_time_to_msec(budget), b[2]);
-WVTEST_MAIN("cancelation")
-{
/* Cancel N contracts */
for (i=0; i<N; i++) {
ret = WVFRSH(frsh_contract_cancel(vres[i]));