Gems/Atom/RPI/Code/Tests/Buffer/BufferTests.cpp
TEST_F(BufferTests, SetEmptyBuffer)
    {
        using namespace AZ;

        //Use a valid buffer for the buffer descriptor
        ExpectedBuffer validBuffer = CreateValidBuffer();

        RPI::BufferAssetCreator creator;

        creator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()));

        // Setting nullptr should succeed if the buffer descriptor is valid
        // as the BufferAsset should be usable for R/W buffers
        creator.SetBuffer(nullptr, 0, validBuffer.m_bufferDescriptor);

        ASSERT_EQ(0, creator.GetErrorCount());
        ASSERT_EQ(0, creator.GetWarningCount());
    }
// Test that if we try to set empty data on the BufferAssetCreator
// that it works as intended
Test that if we try to set empty data on the BufferAssetCreator
that it works as intended
Test that if we try to set empty data on the BufferAssetCreator that it works as intended
TEST_F(BufferTests, SetEmptyBuffer)
    {
        using namespace AZ;
        ExpectedBuffer validBuffer = CreateValidBuffer();
        RPI::BufferAssetCreator creator;
        creator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()));
        creator.SetBuffer(nullptr, 0, validBuffer.m_bufferDescriptor);
        ASSERT_EQ(0, creator.GetErrorCount());
        ASSERT_EQ(0, creator.GetWarningCount());
    }
TEST_F ( BufferTests , SetEmptyBuffer ) { using namespace AZ ; ExpectedBuffer validBuffer = CreateValidBuffer ( ) ; RPI :: BufferAssetCreator creator ; creator . Begin ( Data :: AssetId ( AZ :: Uuid :: CreateRandom ( ) ) ) ; creator . SetBuffer ( nullptr , 0 , validBuffer . m_bufferDescriptor ) ; ASSERT_EQ ( 0 , creator . GetErrorCount ( ) ) ; ASSERT_EQ ( 0 , creator . GetWarningCount ( ) ) ; }
Test that if we try to set empty data on the BufferAssetCreator
that it works as intended
Test that if we try to set empty data on the BufferAssetCreator that it works as intended
//Use a valid buffer for the buffer descriptor // Setting nullptr should succeed if the buffer descriptor is valid // as the BufferAsset should be usable for R/W buffers