Skip to content

Commit

Permalink
update code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Nov 13, 2023
1 parent 1e1e7a1 commit ad40e04
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tmx/TmxUtils/test/test_SNMPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ namespace unit_test
{
public:
shared_ptr<snmp_client> scPtr;
uint16_t port = 161;
test_SNMPClient()
{
uint16_t port = 161;
scPtr = make_shared<snmp_client>("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());
Expand Down Expand Up @@ -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));
}

}

0 comments on commit ad40e04

Please sign in to comment.