forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add death tests for NOT_IMPLEMENTED methods.
- Loading branch information
Reuven Lazarus
committed
May 25, 2017
1 parent
1e4ed13
commit 18fb3c2
Showing
6 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "common/network/address_impl.h" | ||
|
||
#include "server/config_validation/dispatcher.h" | ||
|
||
#include "test/mocks/network/mocks.h" | ||
#include "test/mocks/ssl/mocks.h" | ||
#include "test/mocks/stats/mocks.h" | ||
|
||
namespace Envoy { | ||
namespace Event { | ||
|
||
using testing::KilledBySignal; | ||
using testing::NiceMock; | ||
|
||
TEST(ValidationDispatcherTest, UnimplementedMethods) { | ||
ValidationDispatcher dispatcher; | ||
Network::Address::InstanceConstSharedPtr address{ | ||
new Network::Address::Ipv4Instance("0.0.0.0", 0)}; | ||
EXPECT_EXIT(dispatcher.createClientConnection(address), KilledBySignal(SIGABRT), | ||
"not implemented"); | ||
NiceMock<Ssl::MockClientContext> client_context; | ||
EXPECT_EXIT(dispatcher.createSslClientConnection(client_context, address), | ||
KilledBySignal(SIGABRT), "not implemented"); | ||
EXPECT_EXIT(dispatcher.createDnsResolver(), KilledBySignal(SIGABRT), "not implemented"); | ||
NiceMock<Network::MockConnectionHandler> handler; | ||
NiceMock<Network::MockListenSocket> socket; | ||
NiceMock<Network::MockListenerCallbacks> callbacks; | ||
NiceMock<Stats::MockStore> scope; | ||
Network::ListenerOptions options; | ||
EXPECT_EXIT(dispatcher.createListener(handler, socket, callbacks, scope, options), | ||
KilledBySignal(SIGABRT), "not implemented"); | ||
NiceMock<Ssl::MockServerContext> server_context; | ||
EXPECT_EXIT( | ||
dispatcher.createSslListener(handler, server_context, socket, callbacks, scope, options), | ||
KilledBySignal(SIGABRT), "not implemented"); | ||
} | ||
|
||
} // Event | ||
} // Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters