2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-02-14 12:52:17 +00:00
Files
mysql/test/integration/quit_connection.cpp
2020-04-21 19:47:21 +01:00

39 lines
967 B
C++

//
// Copyright (c) 2019-2020 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "integration_test_common.hpp"
using namespace boost::mysql::test;
using boost::mysql::error_code;
namespace
{
template <typename Stream>
struct QuitConnectionTest : public NetworkTest<Stream>
{
void ActiveConnection_ClosesIt()
{
network_functions<Stream>* net = this->GetParam().net;
// Quit
auto result = net->quit(this->conn);
result.validate_no_error();
// We are no longer able to query
auto query_result = net->query(this->conn, "SELECT 1");
EXPECT_NE(query_result.err, error_code());
}
};
BOOST_MYSQL_NETWORK_TEST_SUITE(QuitConnectionTest)
BOOST_MYSQL_NETWORK_TEST(QuitConnectionTest, ActiveConnection_ClosesIt)
} // anon namespace