File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,24 @@ TEST_CASE("monitor init event count", "[monitor]")
8585 CHECK (monitor.total == expected_event_count);
8686}
8787
88+ #if __cplusplus >= 202002L
89+ static_assert (requires {
90+ [](){
91+ mock_monitor_t monitor;
92+ monitor.check_event ();
93+ monitor.check_event (0 );
94+ monitor.check_event (100 );
95+ monitor.check_event (std::chrono::milliseconds{0 });
96+ monitor.check_event (std::chrono::milliseconds{100 });
97+ monitor.check_event (std::chrono::microseconds{100 });
98+ monitor.check_event (std::chrono::nanoseconds{100 });
99+ monitor.check_event (std::chrono::seconds{100 });
100+ monitor.check_event (std::chrono::minutes{100 });
101+ monitor.check_event (std::chrono::hours{100 });
102+ }();
103+ });
104+ #endif
105+
88106TEST_CASE (" monitor init abort" , " [monitor]" )
89107{
90108 class mock_monitor : public mock_monitor_t
Original file line number Diff line number Diff line change @@ -2373,7 +2373,7 @@ class monitor_t
23732373 template <typename Duration = std::chrono::milliseconds>
23742374 bool check_event (Duration timeout = std::chrono::milliseconds{0 })
23752375 {
2376- return check_event (std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count ());
2376+ return check_event (static_cast < int >( std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count () ));
23772377 }
23782378#endif
23792379
You can’t perform that action at this time.
0 commit comments