diff options
author | Vijay Pai <vpai@google.com> | 2016-02-11 05:37:18 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-02-11 05:37:18 -0800 |
commit | d472ad2a7fe19474409a5dff1afab5244072fda4 (patch) | |
tree | 2338343d944401a74384815480eea34373b675e3 /test | |
parent | 9982c6fc3a9bf435c963a057fcc853fec8c48e5e (diff) | |
parent | 810a13e2d3fef85c706ef5c80dd12bb864a2ab6b (diff) |
Merge branch 'alarm_mods' into alarm_openloop
Diffstat (limited to 'test')
-rwxr-xr-x | test/core/bad_client/gen_build_yaml.py | 8 | ||||
-rwxr-xr-x | test/core/bad_ssl/gen_build_yaml.py | 12 | ||||
-rwxr-xr-x | test/core/end2end/gen_build_yaml.py | 8 | ||||
-rw-r--r-- | test/cpp/common/alarm_cpp_test.cc (renamed from test/cpp/common/alarm_test.cc) | 29 |
4 files changed, 30 insertions, 27 deletions
diff --git a/test/core/bad_client/gen_build_yaml.py b/test/core/bad_client/gen_build_yaml.py index f37aa66c5f..c538bffd71 100755 --- a/test/core/bad_client/gen_build_yaml.py +++ b/test/core/bad_client/gen_build_yaml.py @@ -67,7 +67,9 @@ def main(): 'vs_proj_dir': 'test/bad_client', 'deps': [ 'grpc_test_util_unsecure', - 'grpc_unsecure' + 'grpc_unsecure', + 'gpr_test_util', + 'gpr' ] }], 'targets': [ @@ -82,7 +84,9 @@ def main(): 'deps': [ 'bad_client_test', 'grpc_test_util_unsecure', - 'grpc_unsecure' + 'grpc_unsecure', + 'gpr_test_util', + 'gpr' ] } for t in sorted(BAD_CLIENT_TESTS.keys())]} diff --git a/test/core/bad_ssl/gen_build_yaml.py b/test/core/bad_ssl/gen_build_yaml.py index 9f05fed485..cc097a8fdf 100755 --- a/test/core/bad_ssl/gen_build_yaml.py +++ b/test/core/bad_ssl/gen_build_yaml.py @@ -58,7 +58,9 @@ def main(): 'platforms': ['linux', 'posix', 'mac'], 'deps': [ 'grpc_test_util', - 'grpc' + 'grpc', + 'gpr_test_util', + 'gpr' ] } ], @@ -74,7 +76,9 @@ def main(): 'deps': [ 'bad_ssl_test_server', 'grpc_test_util', - 'grpc' + 'grpc', + 'gpr_test_util', + 'gpr' ] } for t in sorted(BAD_CLIENT_TESTS.keys())] + [ @@ -88,7 +92,9 @@ def main(): 'platforms': ['linux', 'posix', 'mac'], 'deps': [ 'grpc_test_util', - 'grpc' + 'grpc', + 'gpr_test_util', + 'gpr' ] } for t in sorted(BAD_CLIENT_TESTS.keys())]} diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index d4fa7ab518..f24dbe72cf 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -152,11 +152,15 @@ def main(): sec_deps = [ 'end2end_certs', 'grpc_test_util', - 'grpc' + 'grpc', + 'gpr_test_util', + 'gpr' ] unsec_deps = [ 'grpc_test_util_unsecure', - 'grpc_unsecure' + 'grpc_unsecure', + 'gpr_test_util', + 'gpr' ] json = { '#': 'generated with test/end2end/gen_build_json.py', diff --git a/test/cpp/common/alarm_test.cc b/test/cpp/common/alarm_cpp_test.cc index 09df6852a5..4745ef14ec 100644 --- a/test/cpp/common/alarm_test.cc +++ b/test/cpp/common/alarm_cpp_test.cc @@ -35,58 +35,47 @@ #include <grpc++/completion_queue.h> #include <gtest/gtest.h> -#include <grpc++/completion_queue.h> #include "test/core/util/test_config.h" namespace grpc { namespace { -class TestTag : public CompletionQueueTag { - public: - TestTag() : tag_(0) {} - TestTag(intptr_t tag) : tag_(tag) {} - bool FinalizeResult(void** tag, bool* status) { return true; } - intptr_t tag() { return tag_; } - - private: - intptr_t tag_; -}; - TEST(AlarmTest, RegularExpiry) { CompletionQueue cq; - TestTag input_tag(1618033); - Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), &input_tag); + void* junk = reinterpret_cast<void*>(1618033); + Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), junk); - TestTag* output_tag; + void* output_tag; bool ok; const CompletionQueue::NextStatus status = cq.AsyncNext( (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2)); EXPECT_EQ(status, CompletionQueue::GOT_EVENT); EXPECT_TRUE(ok); - EXPECT_EQ(output_tag->tag(), input_tag.tag()); + EXPECT_EQ(junk, output_tag); } TEST(AlarmTest, Cancellation) { CompletionQueue cq; - TestTag input_tag(1618033); - Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), &input_tag); + void* junk = reinterpret_cast<void*>(1618033); + Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), junk); alarm.Cancel(); - TestTag* output_tag; + 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(output_tag->tag(), input_tag.tag()); + EXPECT_EQ(junk, output_tag); } } // namespace } // namespace grpc int main(int argc, char** argv) { + grpc_test_init(argc, argv); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } |