Commit 41f528a9 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[1228] Initial test skeletons added.

parent 0fed56c3
......@@ -41,7 +41,7 @@ static const uint8_t packed[] = {
1, 1, 0, 1, 114 // opt5 (5 bytes)
};
TEST_F(LibDhcpTest, packOptions6) {
TEST(LibDhcpTest, packOptions6) {
boost::shared_array<uint8_t> buf(new uint8_t[512]);
isc::dhcp::Option::Option6Collection opts; // list of options
......@@ -70,7 +70,7 @@ TEST_F(LibDhcpTest, packOptions6) {
EXPECT_EQ(0, memcmp(&buf[100], packed, 35) );
}
TEST_F(LibDhcpTest, unpackOptions6) {
TEST(LibDhcpTest, unpackOptions6) {
// just couple of random options
// Option is used as a simple option implementation
......@@ -134,4 +134,14 @@ TEST_F(LibDhcpTest, unpackOptions6) {
EXPECT_TRUE(x == options.end()); // option 32000 not found
}
TEST(LibDhcpTest, packOptions4) {
// TODO
ASSERT_TRUE(false);
}
TEST(LibDhcpTest, unpackOptions4) {
// TODO
ASSERT_TRUE(false);
}
}
......@@ -35,7 +35,7 @@ public:
};
// v4 is not really implemented yet. A simple test will do for now
TEST_F(OptionTest, basic4) {
TEST_F(OptionTest, v4_basic) {
Option* opt = new Option(Option::V4, 17);
......@@ -48,8 +48,23 @@ TEST_F(OptionTest, basic4) {
);
}
TEST_F(OptionTest, v4_data) {
// TODO
ASSERT_TRUE(false);
}
TEST_F(OptionTest, v4_addgetdel) {
// TODO
ASSERT_TRUE(false);
}
TEST_F(OptionTest, v4_toText) {
// TODO
ASSERT_TRUE(false);
}
// tests simple constructor
TEST_F(OptionTest, basic6) {
TEST_F(OptionTest, v6_basic) {
Option* opt = new Option(Option::V6, 1);
......@@ -64,7 +79,7 @@ TEST_F(OptionTest, basic6) {
// tests contructor used in pkt reception
// option contains actual data
TEST_F(OptionTest, data1) {
TEST_F(OptionTest, v6_data1) {
boost::shared_array<uint8_t> buf(new uint8_t[32]);
for (int i = 0; i < 32; i++)
buf[i] = 100+i;
......@@ -96,7 +111,7 @@ TEST_F(OptionTest, data1) {
// another text that tests the same thing, just
// with different input parameters
TEST_F(OptionTest, data2) {
TEST_F(OptionTest, v6_data2) {
boost::shared_array<uint8_t> simple_buf(new uint8_t[128]);
for (int i = 0; i < 128; i++)
......@@ -144,7 +159,7 @@ TEST_F(OptionTest, data2) {
// |
// +----opt3
//
TEST_F(OptionTest, suboptions1) {
TEST_F(OptionTest, v6_suboptions1) {
boost::shared_array<uint8_t> buf(new uint8_t[128]);
for (int i=0; i<128; i++)
buf[i] = 100+i;
......@@ -184,13 +199,13 @@ TEST_F(OptionTest, suboptions1) {
);
}
// check that an option can contain 2 suboptions:
// check that an option can contain nested suboptions:
// opt1
// +----opt2
// |
// +----opt3
//
TEST_F(OptionTest, suboptions2) {
TEST_F(OptionTest, v6_suboptions2) {
boost::shared_array<uint8_t> buf(new uint8_t[128]);
for (int i=0; i<128; i++)
buf[i] = 100+i;
......@@ -226,7 +241,7 @@ TEST_F(OptionTest, suboptions2) {
);
}
TEST_F(OptionTest, addgetdel) {
TEST_F(OptionTest, v6_addgetdel) {
boost::shared_array<uint8_t> buf(new uint8_t[128]);
for (int i=0; i<128; i++)
buf[i] = 100+i;
......@@ -266,7 +281,7 @@ TEST_F(OptionTest, addgetdel) {
}
TEST_F(OptionTest, toText) {
TEST_F(OptionTest, v6_toText) {
boost::shared_array<uint8_t> buf(new uint8_t[3]);
buf[0] = 0;
buf[1] = 0xf;
......
......@@ -433,4 +433,19 @@ TEST(Pkt4Test, file) {
}
TEST(Pkt4Test, options) {
// TODO
ASSERT_TRUE(false);
}
TEST(Pkt4Test, packOptions) {
// TODO
ASSERT_TRUE(false);
}
TEST(Pkt4Test, unpackOptions) {
// TODO
ASSERT_TRUE(false);
}
} // end of anonymous namespace
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment