Preapre codebase for FileRequest compiletime improvements (#6192)
* Preapre codebase for FileRequest compiletime improvements This is preparing grounds for the next PR that will contain the 'meat' of the changes. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove spurious newline. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
@@ -89,7 +89,7 @@ namespace AZ::IO
|
||||
m_context = nullptr;
|
||||
|
||||
AllocatorInstance<ThreadPoolAllocator>::Destroy();
|
||||
AllocatorInstance<PoolAllocator>::Destroy();
|
||||
AllocatorInstance<PoolAllocator>::Destroy();
|
||||
|
||||
UnitTest::AllocatorsFixture::TearDown();
|
||||
}
|
||||
@@ -123,7 +123,7 @@ namespace AZ::IO
|
||||
.WillRepeatedly(Return(false));
|
||||
EXPECT_CALL(*m_mock, QueueRequest(_));
|
||||
EXPECT_CALL(*m_mock, UpdateStatus(_)).Times(AnyNumber());
|
||||
|
||||
|
||||
switch (mockResult)
|
||||
{
|
||||
case ReadResult::Success:
|
||||
@@ -267,7 +267,7 @@ namespace AZ::IO
|
||||
{
|
||||
allCompleted = allCompleted && request.GetStatus() == IStreamerTypes::RequestStatus::Completed;
|
||||
};
|
||||
|
||||
|
||||
FileRequest* requests[count];
|
||||
AZStd::unique_ptr<u32[]> buffers[count];
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
@@ -300,7 +300,7 @@ namespace AZ::IO
|
||||
size = size >> 2;
|
||||
for (u64 i = 0; i < size; ++i)
|
||||
{
|
||||
// Using assert here because in case of a problem EXPECT would
|
||||
// Using assert here because in case of a problem EXPECT would
|
||||
// cause a large amount of log noise.
|
||||
ASSERT_EQ(buffer[i], offset + (i << 2));
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace AZ::IO
|
||||
.Times(2)
|
||||
.WillRepeatedly([this](FileRequest* request) { m_context.MarkRequestAsCompleted(request); });
|
||||
m_context.FinalizeCompletedRequests();
|
||||
|
||||
|
||||
azfree(memory);
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace AZ::IO
|
||||
m_context.FinalizeCompletedRequests();
|
||||
|
||||
EXPECT_EQ(2, completedRequests);
|
||||
|
||||
|
||||
azfree(memory1);
|
||||
azfree(memory0);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace AZ::IO
|
||||
{
|
||||
using ::testing::_;
|
||||
using ::testing::AnyNumber;
|
||||
|
||||
|
||||
UnitTest::AllocatorsFixture::SetUp();
|
||||
|
||||
m_mock = AZStd::make_shared<StreamStackEntryMock>();
|
||||
@@ -78,7 +78,7 @@ namespace AZ::IO
|
||||
{
|
||||
using ::testing::_;
|
||||
using ::testing::AtLeast;
|
||||
|
||||
|
||||
EXPECT_CALL(*m_mock, UpdateStatus(_)).Times(AtLeast(1));
|
||||
EXPECT_CALL(*m_mock, UpdateCompletionEstimates(_, _, _, _)).Times(AtLeast(1));
|
||||
EXPECT_CALL(*m_mock, PrepareRequest(_))
|
||||
@@ -115,7 +115,7 @@ namespace AZ::IO
|
||||
void MockAllocatorForUnclaimedMemory(IStreamerTypes::RequestMemoryAllocatorMock& mock, AZStd::binary_semaphore& sync)
|
||||
{
|
||||
using ::testing::_;
|
||||
|
||||
|
||||
EXPECT_CALL(mock, LockAllocator()).Times(1);
|
||||
EXPECT_CALL(mock, UnlockAllocator())
|
||||
.Times(1)
|
||||
@@ -256,13 +256,13 @@ namespace AZ::IO
|
||||
using ::testing::_;
|
||||
using ::testing::AtLeast;
|
||||
using ::testing::Return;
|
||||
|
||||
|
||||
EXPECT_CALL(*m_mock, UpdateStatus(_)).Times(AtLeast(1));
|
||||
EXPECT_CALL(*m_mock, UpdateCompletionEstimates(_, _, _, _)).Times(AtLeast(1));
|
||||
EXPECT_CALL(*m_mock, PrepareRequest(_)).Times(AtLeast(1));
|
||||
EXPECT_CALL(*m_mock, ExecuteRequests()).Times(AtLeast(1));
|
||||
EXPECT_CALL(*m_mock, QueueRequest(_)).Times(1);
|
||||
|
||||
|
||||
AZStd::atomic_int counter = 2;
|
||||
AZStd::binary_semaphore sync;
|
||||
auto wait = [&sync, &counter](FileRequestHandle)
|
||||
@@ -350,7 +350,7 @@ namespace AZ::IO
|
||||
|
||||
EXPECT_CALL(*m_mock, UpdateStatus(_)).Times(AnyNumber());
|
||||
EXPECT_CALL(*m_mock, UpdateCompletionEstimates(_, _, _, _)).Times(AnyNumber());
|
||||
|
||||
|
||||
// Pretend to be busy [Iterations] times, then set the status to idle so the Scheduler thread can exit.
|
||||
EXPECT_CALL(*m_mock, ExecuteRequests())
|
||||
.Times(Iterations + 1)
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace AZ::IO
|
||||
TYPED_TEST_P(StreamStackEntryConformityTests, SetContext_ContextIsForwardedToNext_SetContextOnMockIsCalled)
|
||||
{
|
||||
using ::testing::_;
|
||||
|
||||
|
||||
auto mock = AZStd::make_shared<StreamStackEntryMock>();
|
||||
auto entry = this->m_description.CreateInstance();
|
||||
entry.SetNext(mock);
|
||||
@@ -194,14 +194,14 @@ namespace AZ::IO
|
||||
TYPED_TEST_P(StreamStackEntryConformityTests, UpdateStatus_ForwardsCallToNext_NextRecievedCall)
|
||||
{
|
||||
using ::testing::_;
|
||||
|
||||
|
||||
auto mock = AZStd::make_shared<StreamStackEntryMock>();
|
||||
auto entry = this->m_description.CreateInstance();
|
||||
entry.SetNext(mock);
|
||||
|
||||
EXPECT_CALL(*mock, UpdateStatus(_))
|
||||
.Times(1);
|
||||
|
||||
|
||||
StreamStackEntry::Status status;
|
||||
entry.UpdateStatus(status);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ namespace AZ::IO
|
||||
TYPED_TEST_P(StreamStackEntryConformityTests, UpdateStatus_NextHasSmallerNumSlots_ReturnsSmallestNumSlots)
|
||||
{
|
||||
using ::testing::_;
|
||||
|
||||
|
||||
if (this->m_description.UsesSlots())
|
||||
{
|
||||
auto mock = AZStd::make_shared<StreamStackEntryMock>();
|
||||
@@ -264,7 +264,7 @@ namespace AZ::IO
|
||||
TYPED_TEST_P(StreamStackEntryConformityTests, UpdateStatus_NextHasLargerNumSlots_ReturnsSmallestNumSlots)
|
||||
{
|
||||
using ::testing::_;
|
||||
|
||||
|
||||
if (this->m_description.UsesSlots())
|
||||
{
|
||||
auto mock = AZStd::make_shared<StreamStackEntryMock>();
|
||||
@@ -289,7 +289,7 @@ namespace AZ::IO
|
||||
TYPED_TEST_P(StreamStackEntryConformityTests, UpdateCompletionEstimates_ForwardsCallToNext_NextRecievedCall)
|
||||
{
|
||||
using ::testing::_;
|
||||
|
||||
|
||||
auto mock = AZStd::make_shared<StreamStackEntryMock>();
|
||||
auto entry = this->m_description.CreateInstance();
|
||||
entry.SetNext(mock);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user