Skip to content

Commit

Permalink
Removed old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-odintsov committed Jul 18, 2023
1 parent 2839d98 commit f2a4287
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions src/fastnetmon_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

#include "fast_library.hpp"

#include "bgp_protocol.hpp"
#include "bgp_protocol_flow_spec.hpp"

#include <fstream>

#include "log4cpp/Appender.hh"
Expand All @@ -21,67 +18,6 @@

log4cpp::Category& logger = log4cpp::Category::getRoot();

// Flow Spec actions tests

TEST(BgpFlowSpecAction, rate_limit) {
bgp_flow_spec_action_t my_action;
my_action.set_type(FLOW_SPEC_ACTION_RATE_LIMIT);
my_action.set_rate_limit(1024);

EXPECT_EQ(my_action.serialize(), "rate-limit 1024;");
}

TEST(BgpFlowSpecAction, discard) {
bgp_flow_spec_action_t my_action;
my_action.set_type(FLOW_SPEC_ACTION_DISCARD);

EXPECT_EQ(my_action.serialize(), "discard;");
}

TEST(BgpFlowSpecAction, accept) {
bgp_flow_spec_action_t my_action;
my_action.set_type(FLOW_SPEC_ACTION_ACCEPT);

EXPECT_EQ(my_action.serialize(), "accept;");
}

TEST(BgpFlowSpecAction, default_constructor) {
bgp_flow_spec_action_t my_action;

EXPECT_EQ(my_action.serialize(), "accept;");
}

// Serializers tests

TEST(serialize_vector_by_string, single_element) {
std::vector<std::string> vect;
vect.push_back("123");

EXPECT_EQ(serialize_vector_by_string(vect, ","), "123");
}

TEST(serialize_vector_by_string, few_elements) {
std::vector<std::string> vect;
vect.push_back("123");
vect.push_back("456");

EXPECT_EQ(serialize_vector_by_string(vect, ","), "123,456");
}

TEST(serialize_vector_by_string_with_prefix, single_element) {
std::vector<uint16_t> vect;
vect.push_back(123);

EXPECT_EQ(serialize_vector_by_string_with_prefix(vect, ",", "^"), "^123");
}

TEST(serialize_vector_by_string_with_prefix, few_elements) {
std::vector<uint16_t> vect;
vect.push_back(123);
vect.push_back(456);

EXPECT_EQ(serialize_vector_by_string_with_prefix(vect, ",", "^"), "^123,^456");
}

/* Patricia tests */

Expand Down

0 comments on commit f2a4287

Please sign in to comment.