BIND 10 trac2669, updated. bc2a0da61893dc52ab49851360c23c5fbe18dfe6 [2669] Use vector instead of raw array in unit test
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Feb 14 11:03:17 UTC 2013
The branch, trac2669 has been updated
via bc2a0da61893dc52ab49851360c23c5fbe18dfe6 (commit)
from 7725df2d751443bf37be18f1640c5c86a8a9df79 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bc2a0da61893dc52ab49851360c23c5fbe18dfe6
Author: Jelte Jansen <jelte at isc.org>
Date: Thu Feb 14 12:02:52 2013 +0100
[2669] Use vector instead of raw array in unit test
-----------------------------------------------------------------------
Summary of changes:
src/lib/asiolink/tests/tcp_socket_unittest.cc | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/asiolink/tests/tcp_socket_unittest.cc b/src/lib/asiolink/tests/tcp_socket_unittest.cc
index fd55bf0..20b6cd8 100644
--- a/src/lib/asiolink/tests/tcp_socket_unittest.cc
+++ b/src/lib/asiolink/tests/tcp_socket_unittest.cc
@@ -82,10 +82,8 @@ public:
struct PrivateData {
PrivateData() :
error_code_(), length_(0), cumulative_(0), expected_(0), offset_(0),
- name_(""), queued_(NONE), called_(NONE)
- {
- memset(data_, 0, MIN_SIZE);
- }
+ name_(""), queued_(NONE), called_(NONE), data_(MIN_SIZE, 0)
+ {}
asio::error_code error_code_; ///< Completion error code
size_t length_; ///< Bytes transferred in this I/O
@@ -95,8 +93,7 @@ public:
std::string name_; ///< Which of the objects this is
Operation queued_; ///< Queued operation
Operation called_; ///< Which callback called
- uint8_t data_[MIN_SIZE]; ///< Receive buffer
-
+ std::vector<uint8_t> data_; ///< Receive buffer
};
/// \brief Constructor
@@ -171,7 +168,7 @@ public:
/// \brief Get data member
uint8_t* data() {
- return (ptr_->data_);
+ return (&ptr_->data_[0]);
}
/// \brief Get flag to say what was queued
More information about the bind10-changes
mailing list