From 75c78de2b3f4861645aadc0c04869dedf292c985 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 19 Apr 2007 22:29:09 +0200 Subject: [PATCH] a new testcase with the corresponding bug fix. --- src/common/buffer.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 5bb97440d..e725ecd2a 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -140,7 +140,7 @@ Buffer::AddAtStart (uint32_t start) /* enough space but need to move data around to fit new data */ memmove (m_data->m_data + start, GetStart (), m_size); NS_ASSERT (start > m_start); - m_data->m_initialStart += start; + m_data->m_initialStart += start - m_start; m_start = 0; m_size += start; } @@ -647,9 +647,13 @@ BufferTest::RunTests (void) { ok = false; } - - - + + buffer = Buffer (6); + buffer.AddAtStart (9); + buffer.AddAtEnd (3); + i = buffer.End (); + i.Prev (1); + i.WriteU8 (1, 1); return ok; }