Skip to content

Commit

Permalink
debug print.
Browse files Browse the repository at this point in the history
  • Loading branch information
redboltz committed Nov 18, 2024
1 parent 9fe0691 commit 7fbe305
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion test/system/st_offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "../common/global_fixture.hpp"
#include "broker_runner.hpp"
#include "coro_base.hpp"

#include <iostream>
#include <async_mqtt/all.hpp>
#include <boost/asio/yield.hpp>

Expand Down Expand Up @@ -549,6 +549,8 @@ BOOST_AUTO_TEST_CASE(v311_cs0_sp1_from_broker) {
);
BOOST_TEST(!ec);

std::cout << ___LINE__ << std::endl;

// publish QoS1
yield ep(pub).async_send(
am::v3_1_1::publish_packet{
Expand All @@ -571,19 +573,34 @@ BOOST_AUTO_TEST_CASE(v311_cs0_sp1_from_broker) {
},
*this
);

std::cout << ___LINE__ << std::endl;

BOOST_TEST(!ec);
yield ep(pub).async_send(am::v3_1_1::disconnect_packet{}, *this);

std::cout << ___LINE__ << std::endl;

BOOST_TEST(!ec);
yield ep(pub).async_recv(*this);

std::cout << ___LINE__ << std::endl;

BOOST_TEST(!pv_opt); // wait and check close by broker

std::cout << ___LINE__ << std::endl;


yield as::dispatch(
as::bind_executor(
ep(sub).get_executor(),
*this
)
);

std::cout << ___LINE__ << std::endl;


// connect sub
yield ep(sub).async_underlying_handshake(
"127.0.0.1",
Expand Down Expand Up @@ -615,6 +632,9 @@ BOOST_AUTO_TEST_CASE(v311_cs0_sp1_from_broker) {
}
);


std::cout << ___LINE__ << std::endl;

yield ep(sub).async_recv(*this);
BOOST_TEST(
*pv_opt
Expand All @@ -625,6 +645,9 @@ BOOST_AUTO_TEST_CASE(v311_cs0_sp1_from_broker) {
am::qos::at_most_once
})
);

std::cout << ___LINE__ << std::endl;

yield ep(sub).async_recv(*this);
BOOST_TEST(
*pv_opt
Expand All @@ -637,6 +660,9 @@ BOOST_AUTO_TEST_CASE(v311_cs0_sp1_from_broker) {
})
);
yield ep(sub).async_recv(*this);

std::cout << ___LINE__ << std::endl;

BOOST_TEST(
*pv_opt
==
Expand All @@ -648,8 +674,17 @@ BOOST_AUTO_TEST_CASE(v311_cs0_sp1_from_broker) {
})
);
yield ep(sub).async_close(*this);

std::cout << ___LINE__ << std::endl;

set_finish();

std::cout << ___LINE__ << std::endl;

guard.reset();

std::cout << ___LINE__ << std::endl;

}
}
};
Expand Down

0 comments on commit 7fbe305

Please sign in to comment.