Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evolve the test driver framework and adopt it into NTS #225

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,592 changes: 687 additions & 905 deletions groups/nts/ntsa/ntsa_abstract.t.cpp

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions groups/nts/ntsa/ntsa_adapter.t.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2020-2023 Bloomberg Finance L.P.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <ntscfg_test.h>

#include <bsls_ident.h>
BSLS_IDENT_RCSID(ntsa_adapter_t_cpp, "$Id$ $CSID$")

#include <ntsa_adapter.h>

using namespace BloombergLP;

namespace BloombergLP {
namespace ntsa {

// Provide tests for 'ntsa::Adapter'.
class AdapterTest
{
public:
// TODO
static void verify();
};

NTSCFG_TEST_FUNCTION(ntsa::AdapterTest::verify)
{
}

} // close namespace ntsa
} // close namespace BloombergLP
18 changes: 9 additions & 9 deletions groups/nts/ntsa/ntsa_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void ConstBuffer::copy(bdlbb::Blob* blob,
BSLS_ASSERT(0 < currentVecAvailable);
}

int currentVecOffset = static_cast<int>(offset) - prefixLength;
int currentVecOffset = static_cast<int>(offset) - prefixLength;
currentVecAvailable -= currentVecOffset;
BSLS_ASSERT(0 <= currentVecOffset);
BSLS_ASSERT(0 < currentVecAvailable);
Expand All @@ -318,7 +318,7 @@ void ConstBuffer::copy(bdlbb::Blob* blob,
// Compute number of bytes available to read or write in current vec or
// buffer. This must be done *after* setting the blob length.

int currentBufAvailable = blob->buffer(currentBufIndex).size();
int currentBufAvailable = blob->buffer(currentBufIndex).size();
currentBufAvailable -= currentBufOffset;
BSLS_ASSERT(0 < currentBufAvailable);

Expand All @@ -337,11 +337,11 @@ void ConstBuffer::copy(bdlbb::Blob* blob,
int numBytesCopied =
bsl::min(currentVecAvailable, currentBufAvailable);

bsl::memcpy(blob->buffer(currentBufIndex).data() + currentBufOffset,
static_cast<const char*>(
bufferArray[currentVecIndex].buffer()) +
currentVecOffset,
numBytesCopied);
bsl::memcpy(
blob->buffer(currentBufIndex).data() + currentBufOffset,
static_cast<const char*>(bufferArray[currentVecIndex].buffer()) +
currentVecOffset,
numBytesCopied);

currentBufOffset += numBytesCopied;
currentVecOffset += numBytesCopied;
Expand All @@ -352,8 +352,8 @@ void ConstBuffer::copy(bdlbb::Blob* blob,
return;
}
currentVecAvailable =
NTSCFG_WARNING_NARROW(
int, bufferArray[currentVecIndex].length());
NTSCFG_WARNING_NARROW(int,
bufferArray[currentVecIndex].length());
}
else {
currentVecAvailable -= numBytesCopied;
Expand Down
Loading
Loading