From: Francis Dupont Date: Thu, 11 Jun 2015 12:16:54 +0000 (+0200) Subject: [3833] Improved pack_1Byte and pack_2Bytes coding X-Git-Tag: trac3898_base~1^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ba616b76af4c10e313e164d09354d29c2af0d1c;p=thirdparty%2Fkea.git [3833] Improved pack_1Byte and pack_2Bytes coding --- diff --git a/src/lib/dhcp/tests/opaque_data_tuple_unittest.cc b/src/lib/dhcp/tests/opaque_data_tuple_unittest.cc index 95f4c6fa8a..067f7661cd 100644 --- a/src/lib/dhcp/tests/opaque_data_tuple_unittest.cc +++ b/src/lib/dhcp/tests/opaque_data_tuple_unittest.cc @@ -267,7 +267,7 @@ TEST(OpaqueDataTuple, pack1Byte) { EXPECT_THROW(tuple.pack(out_buf), OpaqueDataTupleError); // Set the data for tuple. std::vector data; - for (unsigned i = 0; i < 100; ++i) { + for (uint8_t i = 0; i < 100; ++i) { data.push_back(i); } tuple.assign(data.begin(), data.size()); @@ -289,7 +289,7 @@ TEST(OpaqueDataTuple, pack1Byte) { out_buf.clear(); // Fill in the tuple buffer so as it reaches maximum allowed length. The // maximum length is 255 when the size of the length field is one byte. - for (unsigned i = 100; i < 255; ++i) { + for (uint8_t i = 100; i < 255; ++i) { data.push_back(i); } ASSERT_EQ(255, data.size()); @@ -327,7 +327,7 @@ TEST(OpaqueDataTuple, pack2Bytes) { // Set the data for tuple. std::vector data; for (unsigned i = 0; i < 512; ++i) { - data.push_back(i); + data.push_back(i & 0xff); } tuple.assign(data.begin(), data.size()); // The pack should now succeed.