Skip to content

Commit

Permalink
Macro name conflict fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anarthal committed Oct 30, 2023
1 parent a84bb18 commit 50bb87d
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions test/unit/test/sansio/algo_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <boost/mysql/impl/internal/sansio/sansio_algorithm.hpp>

#include <boost/asio/coroutine.hpp>
#include <boost/asio/yield.hpp>
#include <boost/core/span.hpp>
#include <boost/test/unit_test.hpp>

Expand Down Expand Up @@ -63,14 +62,14 @@ BOOST_AUTO_TEST_CASE(read_cached)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return read(seqnum);
BOOST_ASIO_CORO_YIELD return read(seqnum);
BOOST_TEST(ec == error_code());
BOOST_TEST(seqnum == 1u);
BOOST_MYSQL_ASSERT_BUFFER_EQUALS(st_->reader.message(), msg1);
yield return read(seqnum);
BOOST_ASIO_CORO_YIELD return read(seqnum);
BOOST_TEST(ec == error_code());
BOOST_TEST(seqnum == 2u);
BOOST_MYSQL_ASSERT_BUFFER_EQUALS(st_->reader.message(), msg2);
Expand Down Expand Up @@ -110,10 +109,10 @@ BOOST_AUTO_TEST_CASE(read_short_and_buffer_resizing)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return read(seqnum);
BOOST_ASIO_CORO_YIELD return read(seqnum);
BOOST_TEST(ec == error_code());
BOOST_TEST(seqnum == 1u);
BOOST_MYSQL_ASSERT_BUFFER_EQUALS(st_->reader.message(), msg2);
Expand Down Expand Up @@ -163,10 +162,10 @@ BOOST_AUTO_TEST_CASE(read_parsing_error)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return read(seqnum);
BOOST_ASIO_CORO_YIELD return read(seqnum);
BOOST_TEST(ec == error_code(client_errc::sequence_number_mismatch));
}
return next_action();
Expand Down Expand Up @@ -201,10 +200,10 @@ BOOST_AUTO_TEST_CASE(read_io_error)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return read(seqnum);
BOOST_ASIO_CORO_YIELD return read(seqnum);
BOOST_TEST(ec == error_code(client_errc::wrong_num_params));
}
return next_action();
Expand Down Expand Up @@ -265,10 +264,10 @@ BOOST_AUTO_TEST_CASE(write_short)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return write(mock_message{msg1}, seqnum);
BOOST_ASIO_CORO_YIELD return write(mock_message{msg1}, seqnum);
BOOST_TEST(ec == error_code());
BOOST_TEST(seqnum == 1u);
}
Expand Down Expand Up @@ -307,10 +306,10 @@ BOOST_AUTO_TEST_CASE(write_io_error)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return write(mock_message{msg1}, seqnum);
BOOST_ASIO_CORO_YIELD return write(mock_message{msg1}, seqnum);
BOOST_TEST(ec == error_code(client_errc::wrong_num_params));
}
return next_action();
Expand Down Expand Up @@ -367,10 +366,10 @@ BOOST_AUTO_TEST_CASE(ssl_handshake)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return next_action::ssl_handshake();
BOOST_ASIO_CORO_YIELD return next_action::ssl_handshake();
BOOST_TEST(ec == error_code(client_errc::wrong_num_params));
}
return next_action();
Expand Down Expand Up @@ -402,10 +401,10 @@ BOOST_AUTO_TEST_CASE(ssl_shutdown)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return next_action::ssl_shutdown();
BOOST_ASIO_CORO_YIELD return next_action::ssl_shutdown();
BOOST_TEST(ec == error_code(client_errc::wrong_num_params));
}
return next_action();
Expand Down Expand Up @@ -438,10 +437,10 @@ BOOST_AUTO_TEST_CASE(connect)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return next_action::connect(&connect_arg);
BOOST_ASIO_CORO_YIELD return next_action::connect(&connect_arg);
BOOST_TEST(ec == error_code(client_errc::wrong_num_params));
}
return next_action();
Expand Down Expand Up @@ -474,10 +473,10 @@ BOOST_AUTO_TEST_CASE(close)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return next_action::close();
BOOST_ASIO_CORO_YIELD return next_action::close();
BOOST_TEST(ec == error_code(client_errc::wrong_num_params));
}
return next_action();
Expand Down Expand Up @@ -509,10 +508,10 @@ BOOST_AUTO_TEST_CASE(immediate_completion)

next_action resume(error_code ec)
{
reenter(coro)
BOOST_ASIO_CORO_REENTER(coro)
{
BOOST_TEST(ec == error_code());
yield return next_action();
BOOST_ASIO_CORO_YIELD return next_action();
BOOST_TEST(false); // Should never be called again after next_action() is returned
}
return next_action();
Expand Down

0 comments on commit 50bb87d

Please sign in to comment.