Add a simple logging test
[oweals/dinit.git] / src / tests / test-includes / dinit.h
index a689da74e0bf3bbea82e605c56bbdd6f7a78c700..bf6eb68e77ec05ddc48758673fc4cea1c3abf0e0 100644 (file)
@@ -18,6 +18,7 @@ namespace bp_sys {
     extern pid_t last_forked_pid;
 }
 
+// This is a mock for a Dasynq-based event loop
 class eventloop_t
 {
     time_val current_time {0, 0};
@@ -42,6 +43,14 @@ class eventloop_t
         }
     }
 
+    void send_fd_event(int fd, int events)
+    {
+        auto i = regd_fd_watchers.find(fd);
+        if (i != regd_fd_watchers.end()) {
+            i->second->fd_event(*this, fd, events);
+        }
+    }
+
     class child_proc_watcher
     {
         public: