Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp
TEST_F(ModelTests, SetAabbNoBeginNoBeginMesh)
    {
        using namespace AZ;

        RPI::ModelLodAssetCreator creator;

        AZ::Aabb aabb = AZ::Aabb::CreateCenterRadius(AZ::Vector3::CreateZero(), 1.0f);
        ASSERT_TRUE(aabb.IsValid());

        {
            ErrorMessageFinder messageFinder("Begin() was not called");
            AZ::Aabb testAabb = aabb;
            creator.SetMeshAabb(AZStd::move(testAabb));
        }

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

        //This should still fail even if we call Begin but not BeginMesh
        {
            ErrorMessageFinder messageFinder("BeginMesh() was not called");
            AZ::Aabb testAabb = aabb;
            creator.SetMeshAabb(AZStd::move(testAabb));
        }
    }
// Tests that if we try to set an AABB on a mesh
// without calling Begin or BeginMesh that it fails
// as expected. Also tests the case that Begin *is*
// called but BeginMesh is not.
Tests that if we try to set an AABB on a mesh
without calling Begin or BeginMesh that it fails
as expected. Also tests the case that Begin *is
called but BeginMesh is not.
Tests that if we try to set an AABB on a mesh without calling Begin or BeginMesh that it fails as expected . Also tests the case that Begin * is called but BeginMesh is not .
TEST_F(ModelTests, SetAabbNoBeginNoBeginMesh)
    {
        using namespace AZ;
        RPI::ModelLodAssetCreator creator;
        AZ::Aabb aabb = AZ::Aabb::CreateCenterRadius(AZ::Vector3::CreateZero(), 1.0f);
        ASSERT_TRUE(aabb.IsValid());
        {
            ErrorMessageFinder messageFinder("Begin() was not called");
            AZ::Aabb testAabb = aabb;
            creator.SetMeshAabb(AZStd::move(testAabb));
        }
        creator.Begin(Data::AssetId(AZ::Uuid::CreateRandom()));
        {
            ErrorMessageFinder messageFinder("BeginMesh() was not called");
            AZ::Aabb testAabb = aabb;
            creator.SetMeshAabb(AZStd::move(testAabb));
        }
    }
TEST_F ( ModelTests , SetAabbNoBeginNoBeginMesh ) { using namespace AZ ; RPI :: ModelLodAssetCreator creator ; AZ :: Aabb aabb = AZ :: Aabb :: CreateCenterRadius ( AZ :: Vector3 :: CreateZero ( ) , 1.0f ) ; ASSERT_TRUE ( aabb . IsValid ( ) ) ; { ErrorMessageFinder messageFinder ( " " ) ; AZ :: Aabb testAabb = aabb ; creator . SetMeshAabb ( AZStd :: move ( testAabb ) ) ; } creator . Begin ( Data :: AssetId ( AZ :: Uuid :: CreateRandom ( ) ) ) ; { ErrorMessageFinder messageFinder ( " " ) ; AZ :: Aabb testAabb = aabb ; creator . SetMeshAabb ( AZStd :: move ( testAabb ) ) ; } }
Tests that if we try to set an AABB on a mesh
without calling Begin or BeginMesh that it fails
as expected.
Tests that if we try to set an AABB on a mesh without calling Begin or BeginMesh that it fails as expected .
//This should still fail even if we call Begin but not BeginMesh