OEMCrypto and OPK 19.4

This commit is contained in:
Vicky Min
2024-11-26 20:50:11 +00:00
parent 365ea19c9a
commit b4e12724af
116 changed files with 8156 additions and 2950 deletions

View File

@@ -9,6 +9,8 @@
#include <stdint.h>
#include <unordered_set>
namespace wvutil {
class TestSleep {
@@ -67,13 +69,18 @@ class TestSleep {
static bool real_sleep() { return real_sleep_; }
// The callback is notified whenever sleep is called.
static void set_callback(CallBack* callback) { callback_ = callback; }
static void AddCallback(CallBack* callback) {
callbacks_.insert(callback);
}
static void RemoveCallback(CallBack* callback) {
callbacks_.erase(callback);
}
private:
// Controls if the test sleep should use real sleep.
static bool real_sleep_;
// Called when the clock should advance.
static CallBack* callback_;
static std::unordered_set<CallBack*> callbacks_;
// The sum of all calls to RollBackSystemTime. Kept so we can undo all changes
// at the end of a test.
static int total_clock_rollback_seconds_;