aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-11-08 14:28:03 -0800
committerGravatar Yuchen Zeng <zyc@google.com>2016-11-08 14:28:03 -0800
commit7810898658353056bb6f6cd4c84bfa00ff7c7290 (patch)
treed5ce40e7757d011adc2f2796cfda7cc3aadf4d52 /test/core
parentfdfe41fb036e5489b785db5e8ddeec231e6fdc5a (diff)
Add grpc_socket_mutator_compare
Diffstat (limited to 'test/core')
-rw-r--r--test/core/iomgr/socket_utils_test.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/core/iomgr/socket_utils_test.c b/test/core/iomgr/socket_utils_test.c
index b3363b2be2..7eee2d1d10 100644
--- a/test/core/iomgr/socket_utils_test.c
+++ b/test/core/iomgr/socket_utils_test.c
@@ -45,6 +45,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include <grpc/support/useful.h>
#include "src/core/lib/iomgr/socket_mutator.h"
#include "test/core/util/test_config.h"
@@ -76,8 +77,15 @@ static void destroy_test_mutator(grpc_socket_mutator *mutator) {
gpr_free(m);
}
-static const grpc_socket_mutator_vtable mutator_vtable = {mutate_fd,
- destroy_test_mutator};
+static int compare_test_mutator(grpc_socket_mutator *a,
+ grpc_socket_mutator *b) {
+ struct test_socket_mutator *ma = (struct test_socket_mutator *)a;
+ struct test_socket_mutator *mb = (struct test_socket_mutator *)b;
+ return GPR_ICMP(ma->option_value, mb->option_value);
+}
+
+static const grpc_socket_mutator_vtable mutator_vtable = {
+ mutate_fd, compare_test_mutator, destroy_test_mutator};
int main(int argc, char **argv) {
int sock;