diff --git a/src/tmx/TmxUtils/test/test_SNMPClient.cpp b/src/tmx/TmxUtils/test/test_SNMPClient.cpp index ac30ba057..b0e4978a7 100644 --- a/src/tmx/TmxUtils/test/test_SNMPClient.cpp +++ b/src/tmx/TmxUtils/test/test_SNMPClient.cpp @@ -13,13 +13,18 @@ namespace unit_test { public: shared_ptr scPtr; + uint16_t port = 161; test_SNMPClient() { - uint16_t port = 161; scPtr = make_shared("127.0.0.1", port, "public", "test", "authPriv", "testtesttest", SNMP_VERSION_3, 1000); }; }; + TEST_F(test_SNMPClient, constructor_error) + { + ASSERT_THROW(snmp_client("127.0.0.1", port, "public", "test", "authPriv", "test", SNMP_VERSION_3, 1000), snmp_client_exception); + } + TEST_F(test_SNMPClient, get_port) { ASSERT_EQ(161, scPtr->get_port()); @@ -51,6 +56,9 @@ namespace unit_test ASSERT_FALSE(scPtr->process_snmp_request(RSU_ID_OID, request_type::GET, response)); ASSERT_FALSE(scPtr->process_snmp_request(RSU_ID_OID, request_type::SET, response)); ASSERT_FALSE(scPtr->process_snmp_request(RSU_ID_OID, request_type::OTHER, response)); + + + ASSERT_FALSE(scPtr->process_snmp_request("Invalid OID", request_type::GET, response)); } } \ No newline at end of file