Skip to content

Commit

Permalink
fixup! fixup! fixup! [SQUASH] src: fixup lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Dec 19, 2022
1 parent 19b52aa commit c36be6e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/cctest/test_dataqueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ TEST(DataQueue, InMemoryEntry) {

// We can slice the slice with a length.
// slice: "o w"
std::unique_ptr<DataQueue::Entry> slice2 = slice1->slice(2, Just(5UL));
uint64_t end = 5;
std::unique_ptr<DataQueue::Entry> slice2 = slice1->slice(2, Just(end));

// That slice is idempotent.
CHECK(slice2->isIdempotent());
Expand All @@ -50,7 +51,8 @@ TEST(DataQueue, InMemoryEntry) {

// The slice end can extend beyond the actual size and will be adjusted.
// slice: "orld"
std::unique_ptr<DataQueue::Entry> slice3 = slice1->slice(5, Just(100UL));
end = 100;
std::unique_ptr<DataQueue::Entry> slice3 = slice1->slice(5, Just(end));
CHECK_NOT_NULL(slice3);

// The slice size is known.
Expand All @@ -62,12 +64,14 @@ TEST(DataQueue, InMemoryEntry) {
CHECK_EQ(slice4->size().ToChecked(), 0);

// If the slice end is less than the start, we get a zero length slice.
std::unique_ptr<DataQueue::Entry> slice5 = entry->slice(2, Just(1UL));
end = 1;
std::unique_ptr<DataQueue::Entry> slice5 = entry->slice(2, Just(end));
CHECK_NOT_NULL(slice5);
CHECK_EQ(slice5->size().ToChecked(), 0);

// If the slice end equal to the start, we get a zero length slice.
std::unique_ptr<DataQueue::Entry> slice6 = entry->slice(2, Just(2UL));
end = 2;
std::unique_ptr<DataQueue::Entry> slice6 = entry->slice(2, Just(end));
CHECK_NOT_NULL(slice6);
CHECK_EQ(slice6->size().ToChecked(), 0);

Expand Down Expand Up @@ -289,7 +293,8 @@ TEST(DataQueue, IdempotentDataQueue) {
testSlice(reader3);

// We can slice correctly across boundaries.
std::shared_ptr<DataQueue> slice2 = data_queue->slice(5, Just(20UL));
uint64_t end = 20;
std::shared_ptr<DataQueue> slice2 = data_queue->slice(5, Just(end));

// The size is known.
CHECK_EQ(slice2->size().ToChecked(), 15);
Expand Down Expand Up @@ -535,7 +540,8 @@ TEST(DataQueue, DataQueueEntry) {
CHECK_EQ(entry->size().ToChecked(), data_queue->size().ToChecked());

// We can slice it since it is idempotent.
std::unique_ptr<DataQueue::Entry> slice = entry->slice(5, Just(20UL));
uint64_t end = 20;
std::unique_ptr<DataQueue::Entry> slice = entry->slice(5, Just(end));

// The slice has the expected length.
CHECK_EQ(slice->size().ToChecked(), 15);
Expand Down

0 comments on commit c36be6e

Please sign in to comment.