File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -237,12 +237,17 @@ class ContextBase : public RootInterface,
237237 WasmResult log (uint32_t /* level */ , std::string_view /* message */ ) override {
238238 return unimplemented ();
239239 }
240- uint32_t getLogLevel () override { return static_cast <uint32_t >(LogLevel::info); }
240+ uint32_t getLogLevel () override {
241+ unimplemented ();
242+ return 0 ;
243+ }
241244 uint64_t getCurrentTimeNanoseconds () override {
242- return std::chrono::system_clock::now ().time_since_epoch ().count ();
245+ unimplemented ();
246+ return 0 ;
243247 }
244248 uint64_t getMonotonicTimeNanoseconds () override {
245- return std::chrono::steady_clock::now ().time_since_epoch ().count ();
249+ unimplemented ();
250+ return 0 ;
246251 }
247252 std::string_view getConfiguration () override {
248253 unimplemented ();
Original file line number Diff line number Diff line change @@ -98,6 +98,17 @@ class TestContext : public ContextBase {
9898
9999 bool isLogged (std::string_view message) { return log_.find (message) != std::string::npos; }
100100
101+ uint64_t getCurrentTimeNanoseconds () override {
102+ return std::chrono::duration_cast<std::chrono::nanoseconds>(
103+ std::chrono::system_clock::now ().time_since_epoch ())
104+ .count ();
105+ }
106+ uint64_t getMonotonicTimeNanoseconds () override {
107+ return std::chrono::duration_cast<std::chrono::nanoseconds>(
108+ std::chrono::steady_clock::now ().time_since_epoch ())
109+ .count ();
110+ }
111+
101112private:
102113 std::string log_;
103114};
You can’t perform that action at this time.
0 commit comments