From: Michal Sojka Date: Thu, 24 Feb 2011 16:29:01 +0000 (+0100) Subject: frsh: Update negotiation test X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/frsh-forb.git/commitdiff_plain/e7c5edc1130d9cbf889f155c6baa1ae4b5d35147 frsh: Update negotiation test There were some inconsistencies and missing comments. --- diff --git a/src/frsh/frsh_api/tests/negotiation.c b/src/frsh/frsh_api/tests/negotiation.c index 69a000bd..8d45b9d4 100644 --- a/src/frsh/frsh_api/tests/negotiation.c +++ b/src/frsh/frsh_api/tests/negotiation.c @@ -74,7 +74,7 @@ WVTEST_MAIN("basic negotiation") WVPASS(fosa_rel_time_to_msec(budget) == b[i]); } - /* Renegotiate the contracts */ + /* 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); @@ -90,6 +90,7 @@ WVTEST_MAIN("basic negotiation") 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], @@ -99,9 +100,9 @@ WVTEST_MAIN("basic negotiation") 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]); /* Cancel N contracts */ for (i=0; i