Skip to content

Commit

Permalink
Fix core tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Sep 14, 2021
1 parent 666b02f commit c3f5089
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 67 deletions.
12 changes: 12 additions & 0 deletions core-tests/src/reactor/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,15 @@ TEST(reactor, add_or_update) {

swoole_event_free();
}

TEST(reactor, defer_task) {
swoole_event_init(SW_EVENTLOOP_WAIT_EXIT);
Reactor *reactor = sw_reactor();
ASSERT_EQ(reactor->max_event_num, SW_REACTOR_MAXEVENTS);

int count = 0;
reactor->defer([&count](void *) { count++; });
swoole_event_wait();
ASSERT_EQ(count, 1);
swoole_event_free();
}
67 changes: 0 additions & 67 deletions core-tests/src/reactor/defer_task.cpp

This file was deleted.

0 comments on commit c3f5089

Please sign in to comment.