Integrating github/staging through commit ab87ed9
This commit is contained in:
@@ -1769,7 +1769,6 @@ namespace UnitTest
|
||||
{
|
||||
return "HelloWorld";
|
||||
};
|
||||
constexpr const TypeParam* compileTimeString1 = MakeCompileTimeString1();
|
||||
constexpr basic_string_view<TypeParam> modifierView("HelloWorld");
|
||||
// A constexpr lambda is used to evaluate non constexpr string_view instances' member functions which
|
||||
// have been marked as constexpr at compile time
|
||||
@@ -2334,7 +2333,6 @@ namespace UnitTest
|
||||
const char* filter1{ "*" };
|
||||
const char* filter2{ "*?" };
|
||||
const char* filter3{ "?*" };
|
||||
const char* testValue{ "" };
|
||||
EXPECT_TRUE(wildcard_match(filter1, "Hello"));
|
||||
EXPECT_TRUE(wildcard_match(filter1, "?"));
|
||||
EXPECT_TRUE(wildcard_match(filter1, "*"));
|
||||
|
||||
@@ -53,35 +53,27 @@ namespace UnitTest
|
||||
{
|
||||
// Trvially validate that we can create and destroy an asset manager instance, and that it's only ready while it's created.
|
||||
|
||||
// Before creation, IsReady() should be false and trying to get an Instance() should cause an assert.
|
||||
// Before creation, IsReady() should be false.
|
||||
EXPECT_FALSE(AssetManager::IsReady());
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
auto& badInstance = AssetManager::Instance();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
|
||||
AssetManager::Descriptor desc;
|
||||
AssetManager::Create(desc);
|
||||
|
||||
// After creation, the system should be ready and queryable via Instance().
|
||||
EXPECT_TRUE(AssetManager::IsReady());
|
||||
auto& goodInstance = AssetManager::Instance();
|
||||
AssetManager::Instance();
|
||||
|
||||
AssetManager::Destroy();
|
||||
|
||||
// After destruction, these should fail again
|
||||
EXPECT_FALSE(AssetManager::IsReady());
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
auto& badInstance2 = AssetManager::Instance();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
#endif // !AZ_TRAIT_DISABLE_FAILED_ASSET_MANAGER_CREATE_DESTROY_TEST
|
||||
|
||||
TEST_F(AssetManagerSystemTest, AssetManager_SetInstance_TriviallyWorks)
|
||||
{
|
||||
// There shouldn't be an instance yet.
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
auto& badInstance = AssetManager::Instance();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
EXPECT_FALSE(AssetManager::IsReady());
|
||||
|
||||
// Create an instance and set it.
|
||||
AssetManager::Descriptor desc;
|
||||
@@ -669,7 +661,6 @@ namespace UnitTest
|
||||
EmptyAssetWithInstanceCount* origData = assetWithData.Get();
|
||||
AssetId origId = assetWithData.GetId();
|
||||
AssetType origType = assetWithData.GetType();
|
||||
AssetLoadBehavior origBehavior = assetWithData.GetAutoLoadBehavior();
|
||||
|
||||
Asset<EmptyAssetWithInstanceCount> assetWithData2(AZStd::move(assetWithData));
|
||||
|
||||
|
||||
@@ -9,10 +9,12 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
@@ -29,10 +31,12 @@ namespace UnitTest
|
||||
m_behaviorContext = aznew AZ::BehaviorContext();
|
||||
|
||||
AZ::ComponentApplicationBus::Handler::BusConnect();
|
||||
AZ::Interface<AZ::ComponentApplicationRequests>::Register(this);
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
AZ::Interface<AZ::ComponentApplicationRequests>::Unregister(this);
|
||||
AZ::ComponentApplicationBus::Handler::BusDisconnect();
|
||||
|
||||
// Just destroy everything before we complete the tear down.
|
||||
@@ -45,7 +49,8 @@ namespace UnitTest
|
||||
// ComponentApplicationBus
|
||||
AZ::ComponentApplication* GetApplication() override { return nullptr; }
|
||||
void RegisterComponentDescriptor(const AZ::ComponentDescriptor*) override {}
|
||||
|
||||
void RegisterEntityAddedEventHandler(AZ::EntityAddedEvent::Handler&) override {}
|
||||
void RegisterEntityRemovedEventHandler(AZ::EntityRemovedEvent::Handler&) override {}
|
||||
void UnregisterComponentDescriptor(const AZ::ComponentDescriptor*) override {}
|
||||
bool AddEntity(AZ::Entity*) override { return true; }
|
||||
bool RemoveEntity(AZ::Entity*) override { return true; }
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace AZ::Debug
|
||||
|
||||
realLogger.Start(logFilePath.c_str());
|
||||
|
||||
LargeBlock& block = logger->RecordEventBegin<LargeBlock>(largeBlockId);
|
||||
logger->RecordEventBegin<LargeBlock>(largeBlockId);
|
||||
logger->RecordEventEnd();
|
||||
|
||||
logger->RecordStringEvent(MessageId, message);
|
||||
|
||||
@@ -97,8 +97,6 @@ namespace UnitTest
|
||||
SAFE_EXPECT_EQ(AZ::ClampedIntegralLimits<ValueType, ClampType>::Max(), (std::numeric_limits<ValueType>::max)());
|
||||
|
||||
// Expect the natural numerical limits of ValueType to be equal to the natural numerical limits of ClampType
|
||||
ValueType vMin = AZ::ClampedIntegralLimits<ValueType, ClampType>::Min();
|
||||
ClampType cMin = std::numeric_limits<ClampType>::lowest();
|
||||
SAFE_EXPECT_EQ(AZ::ClampedIntegralLimits<ValueType, ClampType>::Min(), std::numeric_limits<ClampType>::lowest());
|
||||
SAFE_EXPECT_EQ(AZ::ClampedIntegralLimits<ValueType, ClampType>::Max(), (std::numeric_limits<ClampType>::max)());
|
||||
|
||||
|
||||
@@ -149,7 +149,6 @@ namespace UnitTest
|
||||
::testing::Values(
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>("test/foo", "test/foo"),
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>("test/foo", "test\\foo"),
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>("test/foo", "test\\foo"),
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>("test////foo", "test///foo"),
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>("test/bar/baz//foo", "test/bar/baz\\\\\\foo")
|
||||
));
|
||||
@@ -159,17 +158,35 @@ namespace UnitTest
|
||||
constexpr AZ::IO::FixedMaxPath path1{ "foo/bar" };
|
||||
constexpr AZ::IO::FixedMaxPath path2{ "foo/bap" };
|
||||
constexpr AZ::IO::PathView pathView{ "foo/bar" };
|
||||
static_assert(path1 == pathView);
|
||||
static_assert(path1 != path2);
|
||||
static_assert(path2 < path1);
|
||||
static_assert(pathView <= path1);
|
||||
static_assert(path1 > path2);
|
||||
static_assert(pathView >= path2);
|
||||
EXPECT_EQ(path1, pathView);
|
||||
EXPECT_NE(path1, path2);
|
||||
EXPECT_LT(path2, path1);
|
||||
EXPECT_LE(pathView, path1);
|
||||
EXPECT_GT(path1, path2);
|
||||
EXPECT_GE(pathView, path2);
|
||||
|
||||
static_assert(pathView <= pathView);
|
||||
static_assert(pathView >= pathView);
|
||||
EXPECT_LE(pathView, pathView);
|
||||
EXPECT_GE(pathView, pathView);
|
||||
}
|
||||
|
||||
using WindowsPathCompareParamFixture = PathParamFixture;
|
||||
|
||||
TEST_P(WindowsPathCompareParamFixture, OperatorEqual_ComparesPathCaseInsensitively)
|
||||
{
|
||||
AZ::IO::Path path1{ AZStd::get<0>(GetParam()), AZ::IO::WindowsPathSeparator };
|
||||
AZ::IO::Path path2{ AZStd::get<1>(GetParam()), AZ::IO::WindowsPathSeparator };
|
||||
EXPECT_EQ(path1, path2);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
CompareWindowsPaths,
|
||||
WindowsPathCompareParamFixture,
|
||||
::testing::Values(
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>("C:/test/foo", R"(c:\test/foo)"),
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>(R"(D:\test/bar/baz//foo)", "d:/test/bar/baz\\\\\\foo"),
|
||||
AZStd::tuple<AZStd::string_view, AZStd::string_view>(R"(foO/Bar)", "foo/bar")
|
||||
));
|
||||
|
||||
class PathSingleParamFixture
|
||||
: public ScopedAllocatorSetupFixture
|
||||
, public ::testing::WithParamInterface<AZStd::tuple<AZStd::string_view>>
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix3x3 result = AZ::Matrix3x3::CreateIdentity();
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -78,7 +78,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix3x3 result = AZ::Matrix3x3::CreateZero();
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -134,7 +134,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix3x3 result = AZ::Matrix3x3::CreateFromRowMajorFloat9(s_mat3x3testArray);
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -146,7 +146,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix3x3 result = AZ::Matrix3x3::CreateFromColumnMajorFloat9(s_mat3x3testArray);
|
||||
benchmark::DoNotOptimize(result);
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix3x4 result = AZ::Matrix3x4::CreateIdentity();
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -96,7 +96,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix3x4 result = AZ::Matrix3x4::CreateZero();
|
||||
benchmark::DoNotOptimize(result);
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = AZ::Matrix4x4::CreateIdentity();
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -74,7 +74,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = AZ::Matrix4x4::CreateZero();
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -122,7 +122,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = AZ::Matrix4x4::CreateFromValue(1.0f);
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -134,7 +134,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = AZ::Matrix4x4::CreateFromRowMajorFloat16(s_mat4x4testArray);
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -146,7 +146,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = AZ::Matrix4x4::CreateFromColumnMajorFloat16(s_mat4x4testArray);
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -158,7 +158,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = AZ::Matrix4x4::CreateProjection(s_mat4x4testArray[0], s_mat4x4testArray[1], s_mat4x4testArray[2], s_mat4x4testArray[3]);
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -170,7 +170,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = AZ::Matrix4x4::CreateProjectionFov(s_mat4x4testArray[0], s_mat4x4testArray[1], s_mat4x4testArray[2], s_mat4x4testArray[3]);
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -550,7 +550,7 @@ namespace Benchmark
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Matrix4x4 result = mat.GetInverseTransform();
|
||||
benchmark::DoNotOptimize(result);
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& quatData : m_quatDataArray)
|
||||
for ([[maybe_unused]] auto& quatData : m_quatDataArray)
|
||||
{
|
||||
AZ::Quaternion result = AZ::Quaternion::CreateIdentity();
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -102,7 +102,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& quatData : m_quatDataArray)
|
||||
for ([[maybe_unused]] auto& quatData : m_quatDataArray)
|
||||
{
|
||||
AZ::Quaternion result = AZ::Quaternion::CreateZero();
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -153,7 +153,7 @@ namespace Benchmark
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& quatData : m_quatDataArray)
|
||||
for ([[maybe_unused]] auto& quatData : m_quatDataArray)
|
||||
{
|
||||
AZ::Quaternion result = AZ::Quaternion::CreateShortestArc(vec1, vec2); //result should transform vec1 into vec2
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -168,7 +168,7 @@ namespace Benchmark
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& quatData : m_quatDataArray)
|
||||
for ([[maybe_unused]] auto& quatData : m_quatDataArray)
|
||||
{
|
||||
AZ::Quaternion result = AZ::Quaternion::CreateShortestArc(vec1, vec2); //result should transform vec1 into vec2
|
||||
benchmark::DoNotOptimize(result);
|
||||
@@ -308,7 +308,7 @@ namespace Benchmark
|
||||
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& quatData : m_quatDataArray)
|
||||
for ([[maybe_unused]] auto& quatData : m_quatDataArray)
|
||||
{
|
||||
AZ::Quaternion quat;
|
||||
quat.Set(vec, 8.0f);
|
||||
@@ -322,7 +322,7 @@ namespace Benchmark
|
||||
const float quatArray[4] = { 5.0f, 6.0f, 7.0f, 8.0f };
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& quatData : m_quatDataArray)
|
||||
for ([[maybe_unused]] auto& quatData : m_quatDataArray)
|
||||
{
|
||||
AZ::Quaternion quat;
|
||||
quat.Set(quatArray);
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Benchmark
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
for (auto& testData : m_testDataArray)
|
||||
for ([[maybe_unused]] auto& testData : m_testDataArray)
|
||||
{
|
||||
AZ::Transform result = AZ::Transform::CreateIdentity();
|
||||
benchmark::DoNotOptimize(result);
|
||||
|
||||
-1
@@ -755,7 +755,6 @@ namespace AZ::IO
|
||||
path.InitFromAbsolutePath(m_dummyFilepath + "/Broken/Path.txt");
|
||||
|
||||
request->CreateRead(nullptr, buffer, readSize, path, 0, readSize);
|
||||
bool resultSet = false;
|
||||
EXPECT_CALL(*mock, QueueRequest(request)).
|
||||
WillOnce([this](AZ::IO::FileRequest* request)
|
||||
{
|
||||
|
||||
@@ -1230,6 +1230,8 @@ namespace UnitTest
|
||||
ComponentApplication* GetApplication() override { return nullptr; }
|
||||
void RegisterComponentDescriptor(const ComponentDescriptor*) override { }
|
||||
void UnregisterComponentDescriptor(const ComponentDescriptor*) override { }
|
||||
void RegisterEntityAddedEventHandler(EntityAddedEvent::Handler&) override { }
|
||||
void RegisterEntityRemovedEventHandler(EntityRemovedEvent::Handler&) override { }
|
||||
bool AddEntity(Entity*) override { return false; }
|
||||
bool RemoveEntity(Entity*) override { return false; }
|
||||
bool DeleteEntity(const EntityId&) override { return false; }
|
||||
|
||||
@@ -62,7 +62,6 @@ namespace SettingsRegistryScriptUtilsTests
|
||||
|
||||
TEST_F(SettingsRegistryBehaviorContextFixture, GlobalSettingsRegistry_CanBeQueried_Succeeds)
|
||||
{
|
||||
constexpr const char* IsValidMethodName = "IsValid";
|
||||
constexpr const char* GlobalSettingsRegistryPropertyName = "g_SettingsRegistry";
|
||||
auto propIt = m_behaviorContext->m_properties.find(GlobalSettingsRegistryPropertyName);
|
||||
ASSERT_NE(m_behaviorContext->m_properties.end(), propIt);
|
||||
|
||||
Reference in New Issue
Block a user