aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/common
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/common')
-rw-r--r--test/cpp/common/BUILD4
-rw-r--r--test/cpp/common/alarm_test.cc (renamed from test/cpp/common/alarm_cpp_test.cc)23
-rw-r--r--test/cpp/common/channel_arguments_test.cc2
3 files changed, 26 insertions, 3 deletions
diff --git a/test/cpp/common/BUILD b/test/cpp/common/BUILD
index e2b6365b13..2cf3ad669f 100644
--- a/test/cpp/common/BUILD
+++ b/test/cpp/common/BUILD
@@ -19,8 +19,8 @@ load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package")
grpc_package(name = "test/cpp/common")
grpc_cc_test(
- name = "alarm_cpp_test",
- srcs = ["alarm_cpp_test.cc"],
+ name = "alarm_test",
+ srcs = ["alarm_test.cc"],
deps = [
"//:grpc++_unsecure",
"//test/core/util:gpr_test_util",
diff --git a/test/cpp/common/alarm_cpp_test.cc b/test/cpp/common/alarm_test.cc
index 7adc3102f4..2a933a84c4 100644
--- a/test/cpp/common/alarm_cpp_test.cc
+++ b/test/cpp/common/alarm_test.cc
@@ -182,6 +182,29 @@ TEST(AlarmTest, Cancellation) {
EXPECT_EQ(junk, output_tag);
}
+TEST(AlarmTest, SetDestruction) {
+ CompletionQueue cq;
+ void* junk = reinterpret_cast<void*>(1618033);
+ {
+ Alarm alarm;
+ alarm.Set(&cq, grpc_timeout_seconds_to_deadline(2), junk);
+ }
+
+ void* output_tag;
+ bool ok;
+ const CompletionQueue::NextStatus status = cq.AsyncNext(
+ (void**)&output_tag, &ok, grpc_timeout_seconds_to_deadline(1));
+
+ EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
+ EXPECT_FALSE(ok);
+ EXPECT_EQ(junk, output_tag);
+}
+
+TEST(AlarmTest, UnsetDestruction) {
+ CompletionQueue cq;
+ Alarm alarm;
+}
+
} // namespace
} // namespace grpc
diff --git a/test/cpp/common/channel_arguments_test.cc b/test/cpp/common/channel_arguments_test.cc
index f330c01281..29e225d924 100644
--- a/test/cpp/common/channel_arguments_test.cc
+++ b/test/cpp/common/channel_arguments_test.cc
@@ -20,9 +20,9 @@
#include <grpc++/grpc++.h>
#include <grpc/grpc.h>
-#include <grpc/support/useful.h>
#include <gtest/gtest.h>
+#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/socket_mutator.h"