Gems/Atom/RPI/Code/Tests/Buffer/BufferTests.cpp
// Test that if we try to set an empty buffer with a non-zero
// initial size that the creator fails as expected.
Test that if we try to set an empty buffer with a non-zero
initial size that the creator fails as expected.
Test that if we try to set an empty buffer with a non - zero initial size that the creator fails as expected .
TEST_F(BufferTests, SetEmptyBufferWithNonZeroSize)
    {
        using namespace AZ;
        ExpectedBuffer validBuffer = CreateValidBuffer();
        RPI::BufferAssetCreator creator;
        creator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()));
        creator.SetPoolAsset(CreateTestBufferPoolAsset());
        ErrorMessageFinder messageFinder("Initial buffer data was not provided but the initial size was non-zero.");
        messageFinder.AddIgnoredErrorMessage("Cannot continue building BufferAsset", true);
        creator.SetBuffer(nullptr, 1, validBuffer.m_bufferDescriptor);
        Data::Asset<RPI::BufferAsset> asset;
        ASSERT_FALSE(creator.End(asset));
        ASSERT_FALSE(asset.IsReady());
        ASSERT_EQ(asset.Get(), nullptr);
    }
TEST_F ( BufferTests , SetEmptyBufferWithNonZeroSize ) { using namespace AZ ; ExpectedBuffer validBuffer = CreateValidBuffer ( ) ; RPI :: BufferAssetCreator creator ; creator . Begin ( Data :: AssetId ( AZ :: Uuid :: CreateRandom ( ) ) ) ; creator . SetPoolAsset ( CreateTestBufferPoolAsset ( ) ) ; ErrorMessageFinder messageFinder ( " " ) ; messageFinder . AddIgnoredErrorMessage ( " " , true ) ; creator . SetBuffer ( nullptr , 1 , validBuffer . m_bufferDescriptor ) ; Data :: Asset < RPI :: BufferAsset > asset ; ASSERT_FALSE ( creator . End ( asset ) ) ; ASSERT_FALSE ( asset . IsReady ( ) ) ; ASSERT_EQ ( asset . Get ( ) , nullptr ) ; }
Test that if we try to set an empty buffer with a non-zero
initial size that the creator fails as expected.
Test that if we try to set an empty buffer with a non - zero initial size that the creator fails as expected .
//Use a valid buffer for the bufferDescriptor // Ending the buffer here should also result in failure