Commit 1626b91e authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[2994] Some unit-tests are now passing.

parent 272122f2
......@@ -1722,24 +1722,35 @@ public:
192, 0, 2, 255, // siaddr
255, 255, 255, 255, // giaddr
// Initialize the vector with the header fields defined above.
vector<uint8_t> buf(hdr, hdr + sizeof(hdr));
// Append the large header fields.
copy(dummyChaddr, dummyChaddr + Pkt4::MAX_CHADDR_LEN, back_inserter(buf));
copy(dummySname, dummySname + Pkt4::MAX_SNAME_LEN, back_inserter(buf));
copy(dummyFile, dummyFile + Pkt4::MAX_FILE_LEN, back_inserter(buf));
// Should now have all the header, so check. The "static_cast" is used
// to get round an odd bug whereby the linker appears not to find the
// definition of DHCPV4_PKT_HDR_LEN if it appears within an EXPECT_EQ().
EXPECT_EQ(static_cast<size_t>(Pkt4::DHCPV4_PKT_HDR_LEN), buf.size());
return (Pkt4Ptr(new Pkt4(DHCPDISCOVER, 12345)));
// Add magic cookie
// Add message type DISCOVER
buf.push_back(1); // length (just one byte)
return (Pkt4Ptr(new Pkt4(&buf[0], buf.size())));
/// test callback that stores received callout name and pkt6 value
/// test callback that stores received callout name and pkt4 value
/// @param callout_handle handle passed by the hooks framework
/// @return always 0
static int
Supports Markdown
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