diff --git a/tests/modern_engine_bridge_probe.cpp b/tests/modern_engine_bridge_probe.cpp index 67bd1b3..5c4918c 100644 --- a/tests/modern_engine_bridge_probe.cpp +++ b/tests/modern_engine_bridge_probe.cpp @@ -159,7 +159,7 @@ int main(int argc, char **argv) { run(engine_ticket_command(cancelled,21,"request:owner-released"),"owner-released"); run(engine_contract_request(link->snapshot(),first,"request:quote-reject"),"quote-reject");auto now=link->snapshot();auto q2=engine_contracts_projection(now).at("quote");int year=1;while(year<=4&&q2.at("demands")[size_t(year-1)].is_null())++year;if(year>4)throw std::runtime_error("no available rejection term"); const auto refused=run(engine_contract_offer(now,first,q2.at("id"),year,0,"request:offer-reject"),"offer-reject");if(refused.value("outcome","")!="offer_rejected")throw std::runtime_error("zero offer not actually rejected"); - run(engine_contract_request(link->snapshot(),second,"request:quote-accept"),"quote-accept");now=link->snapshot();q2=engine_contracts_projection(now).at("quote");year=2;while(year<=4&&q2.at("demands")[size_t(year-1)].is_null())++year;if(year>4)year=1; + run(engine_contract_request(link->snapshot(),second,"request:quote-accept"),"quote-accept");now=link->snapshot();q2=engine_contracts_projection(now).at("quote");year=3;while(year<=4&&q2.at("demands")[size_t(year-1)].is_null())++year;if(year>4)year=1; const int64_t salary=q2.at("max_salary").get()/100; const auto accepted=run(engine_contract_offer(now,second,q2.at("id"),year,salary,"request:offer-accept"),"offer-accept");if(accepted.value("outcome","")=="offer_rejected")throw std::runtime_error("maximum salary unexpectedly rejected"); const auto after=link->snapshot();write("contracts-after.json",after);bool found=false;const auto final_contracts=engine_contracts_projection(after);for(const auto &p:final_contracts.at("rows"))if(p.at("id")==second)found=p.at("salary")==salary*100&&p.at("months")==year*12;