diff --git a/src/fastnetmon_tests.cpp b/src/fastnetmon_tests.cpp index 70de04b..b42645f 100644 --- a/src/fastnetmon_tests.cpp +++ b/src/fastnetmon_tests.cpp @@ -3,9 +3,6 @@ #include "fast_library.hpp" -#include "bgp_protocol.hpp" -#include "bgp_protocol_flow_spec.hpp" - #include #include "log4cpp/Appender.hh" @@ -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 vect; - vect.push_back("123"); - - EXPECT_EQ(serialize_vector_by_string(vect, ","), "123"); -} - -TEST(serialize_vector_by_string, few_elements) { - std::vector 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 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 vect; - vect.push_back(123); - vect.push_back(456); - - EXPECT_EQ(serialize_vector_by_string_with_prefix(vect, ",", "^"), "^123,^456"); -} /* Patricia tests */