grpc
test
core
event_engine
smoke_test.cc
Go to the documentation of this file.
1
// Copyright 2022 The gRPC Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
#include <
grpc/support/port_platform.h
>
15
16
#include <gmock/gmock.h>
17
#include <gtest/gtest.h>
18
19
#include <
grpc/event_engine/event_engine.h
>
20
#include <
grpc/grpc.h
>
21
22
#include "
test/core/util/test_config.h
"
23
24
namespace
{
25
26
using ::testing::MockFunction;
27
28
class
EventEngineSmokeTest :
public
testing::Test
{};
29
30
TEST_F
(EventEngineSmokeTest, SetDefaultEventEngineFactoryLinks) {
31
// See https://github.com/grpc/grpc/pull/28707
32
testing::MockFunction
<
33
std::unique_ptr<grpc_event_engine::experimental::EventEngine>()>
34
factory;
35
EXPECT_CALL
(factory,
Call
()).Times(1);
36
grpc_event_engine::experimental::SetDefaultEventEngineFactory
(
37
factory.AsStdFunction());
38
EXPECT_EQ
(
nullptr
,
grpc_event_engine::experimental::CreateEventEngine
());
39
}
40
41
}
// namespace
42
43
int
main
(
int
argc,
char
** argv) {
44
testing::InitGoogleTest
(&argc, argv);
45
grpc::testing::TestEnvironment
env
(&argc, argv);
46
grpc_init
();
47
auto
result
=
RUN_ALL_TESTS
();
48
grpc_shutdown
();
49
return
result
;
50
}
_gevent_test_main.result
result
Definition:
_gevent_test_main.py:96
generate.env
env
Definition:
generate.py:37
grpc_event_engine::experimental::SetDefaultEventEngineFactory
void SetDefaultEventEngineFactory(std::function< std::unique_ptr< EventEngine >()> factory)
Definition:
event_engine.cc:34
event_engine.h
testing::Test
Definition:
bloaty/third_party/googletest/googletest/include/gtest/gtest.h:402
EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition:
iomgr/time_averaged_stats_test.cc:27
grpc.h
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition:
bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
EXPECT_CALL
#define EXPECT_CALL(obj, call)
test_config.h
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition:
bloaty/third_party/googletest/googletest/src/gtest.cc:6106
main
int main(int argc, char **argv)
Definition:
smoke_test.cc:43
tests.unit._server_ssl_cert_config_test.Call
Call
Definition:
_server_ssl_cert_config_test.py:70
testing::MockFunction
Definition:
cares/cares/test/gmock-1.8.0/gmock/gmock.h:11854
grpc::testing::TestEnvironment
Definition:
test/core/util/test_config.h:54
grpc_event_engine::experimental::CreateEventEngine
std::unique_ptr< EventEngine > CreateEventEngine()
Create an EventEngine using the default factory.
Definition:
event_engine.cc:40
grpc_init
GRPCAPI void grpc_init(void)
Definition:
init.cc:146
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition:
init.cc:209
TEST_F
#define TEST_F(test_fixture, test_name)
Definition:
bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2367
port_platform.h
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:13