Skip to content
  • Mike Perry's avatar
    Bug #29500: Fix monotime mocking in circpad unittests. · b733044f
    Mike Perry authored and teor's avatar teor committed
    Our monotime mocking forces us to call monotime_init() *before* we set the
    mocked time value. monotime_init() thus stores the first ratchet value at
    whatever the platform is at, and then we set fake mocked time to some later
    value.
    
    If monotime_init() gets a value from the host that is greater than what we
    choose to mock time at for our unittests, all subsequent monotime_abosolute()
    calls return zero, which breaks all unittests that depend on time moving
    forward by updating mocked monotime values.
    
    So, we need to adjust our mocked time to take the weird monotime_init() time
    into account, when we set fake time.
    b733044f