Skip to content

Commit

Permalink
Update for event loop API changes (#491)
Browse files Browse the repository at this point in the history
Co-authored-by: Bret Ambrose <[email protected]>
  • Loading branch information
bretambrose and Bret Ambrose authored Nov 12, 2024
1 parent f3eef14 commit fc3eded
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
4 changes: 1 addition & 3 deletions tests/test_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@

#include <aws/common/clock.h>
#include <aws/common/condition_variable.h>
#include <aws/common/log_writer.h>
#include <aws/common/hash_table.h>
#include <aws/common/logging.h>
#include <aws/common/string.h>
#include <aws/common/thread.h>
#include <aws/common/uuid.h>
#include <aws/io/channel_bootstrap.h>
#include <aws/io/event_loop.h>
#include <aws/io/logging.h>
#include <aws/io/socket.h>
#include <aws/io/tls_channel_handler.h>
#include <aws/testing/aws_test_harness.h>
Expand Down
15 changes: 5 additions & 10 deletions tests/test_connection_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ static void s_cm_tester_on_cm_shutdown_complete(void *user_data) {
aws_mutex_unlock(&tester->lock);
}

static struct aws_event_loop *s_new_event_loop(
struct aws_allocator *alloc,
const struct aws_event_loop_options *options,
void *new_loop_user_data) {
(void)new_loop_user_data;

return aws_event_loop_new_default(alloc, options->clock);
}

static int s_cm_tester_init(struct cm_tester_options *options) {
struct cm_tester *tester = &s_tester;

Expand Down Expand Up @@ -170,7 +161,11 @@ static int s_cm_tester_init(struct cm_tester_options *options) {
clock_fn = options->mock_table->aws_high_res_clock_get_ticks;
}

tester->event_loop_group = aws_event_loop_group_new(tester->allocator, clock_fn, 1, s_new_event_loop, NULL, NULL);
struct aws_event_loop_group_options elg_options = {
.loop_count = 1,
.clock_override = clock_fn,
};
tester->event_loop_group = aws_event_loop_group_new(tester->allocator, &elg_options);

struct aws_host_resolver_default_options resolver_options = {
.el_group = tester->event_loop_group,
Expand Down

0 comments on commit fc3eded

Please sign in to comment.