/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** @file */ /** * \defgroup test_message_class Tests for Whisper::Message * Test include functional correctness. */ #define CATCH_CONFIG_MAIN #include #include #include /** * \brief Verify that data classification compile and can be used * \ingroup compile_data_tests */ SCENARIO("instantiating a Whisper::Message","[message]") { GIVEN("nothing") { std::unique_ptr msg; WHEN("instantiating some classifications") { REQUIRE_NOTHROW([&]() { msg = std::make_unique(); }()); THEN("default values are set") { REQUIRE(msg->type() == Whisper::MessageType::NONE); REQUIRE(msg->hasEnconding() == false); REQUIRE(msg->id() > 0); REQUIRE(msg->replyId() == 0); REQUIRE(msg->src() == 0); REQUIRE(msg->dst() == 0); REQUIRE_THROWS([&]() { msg->encode(); }()); } } } }