FUZZ: disable check_for_improper_main_declaration
| 8 | |
| 9 | // FUZZ: disable check_for_improper_main_declaration |
| 10 | int main(int, char*[]) |
| 11 | { |
| 12 | // Initialize the TS interface |
| 13 | FACE::RETURN_CODE_TYPE status; |
| 14 | FACE::TS::Initialize("face_config.ini", status); |
| 15 | |
| 16 | if (status != FACE::RC_NO_ERROR) { |
| 17 | return static_cast<int>(status); |
| 18 | } |
| 19 | |
| 20 | // Create the sub connection |
| 21 | FACE::CONNECTION_ID_TYPE connId; |
| 22 | FACE::CONNECTION_DIRECTION_TYPE dir; |
| 23 | FACE::MESSAGE_SIZE_TYPE max_msg_size; |
| 24 | FACE::TS::Create_Connection( |
| 25 | "sub", FACE::PUB_SUB, connId, dir, |
| 26 | max_msg_size, FACE::INF_TIME_VALUE, status); |
| 27 | |
| 28 | if (status != FACE::RC_NO_ERROR) { |
| 29 | return static_cast<int>(status); |
| 30 | } |
| 31 | |
| 32 | // Receive a message |
| 33 | const FACE::TIMEOUT_TYPE timeout = FACE::INF_TIME_VALUE; |
| 34 | FACE::TRANSACTION_ID_TYPE txn; |
| 35 | Messenger::Message msg; |
| 36 | |
| 37 | ACE_DEBUG(( |
| 38 | LM_INFO, "Subscriber: about to Receive_Message()\n")); |
| 39 | |
| 40 | FACE::TS::Receive_Message( |
| 41 | connId, timeout, txn, msg, max_msg_size, status); |
| 42 | |
| 43 | if (status != FACE::RC_NO_ERROR) { |
| 44 | return static_cast<int>(status); |
| 45 | } |
| 46 | |
| 47 | // Output the message |
| 48 | ACE_DEBUG((LM_INFO, "%C\t%d\n", msg.text.in(), msg.count)); |
| 49 | |
| 50 | // Destroy the sub connection |
| 51 | FACE::TS::Destroy_Connection(connId, status); |
| 52 | |
| 53 | if (status != FACE::RC_NO_ERROR) { |
| 54 | return static_cast<int>(status); |
| 55 | } |
| 56 | |
| 57 | return EXIT_SUCCESS; |
| 58 | } |
| 59 | // FUZZ: enable check_for_improper_main_declaration |
nothing calls this directly
no test coverage detected