Convert STAmount switchovers to tls (RIPD-1068)

This commit is contained in:
Miguel Portilla
2016-01-08 15:00:55 -05:00
committed by Edward Hennis
parent 4fb6bf3e67
commit 14dde47173
17 changed files with 93 additions and 142 deletions

View File

@@ -147,18 +147,16 @@ public:
for (int i=0;i<101;++i)
env (offer (carol, USD (1), EUR (2)));
auto const switchoverTime = STAmountCalcSwitchovers::enableUnderflowFixCloseTime ();
for (auto timeDelta : {
- env.closed()->info().closeTimeResolution,
env.closed()->info().closeTimeResolution} )
{
auto const closeTime = switchoverTime + timeDelta;
STAmountCalcSwitchovers switchover (closeTime);
auto const closeTime = STAmountSO::soTime + timeDelta;
env.close (closeTime);
*stAmountCalcSwitchover = closeTime <= STAmountSO::soTime;
// Will fail without the underflow fix
auto expectedResult = switchover.enableUnderflowFix () ?
tesSUCCESS : tecPATH_PARTIAL;
auto expectedResult = *stAmountCalcSwitchover ?
tesSUCCESS : tecPATH_PARTIAL;
env (pay ("alice", "bob", EUR (epsilon)), path (~EUR),
sendmax (USD (100)), ter (expectedResult));
}