Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,528 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Math/Aabb.h>
#include <I3DEngine.h>
#include <ISerialize.h>
#include <gmock/gmock.h>
// the following was generated using google's python script to autogenerate mocks.
// however, it needed some hand-editing to make it work, so if you add functions to I3DEngine,
// it will probably be better to just manually add them here than try to run the script again.
class I3DEngineMock
: public I3DEngine
{
public:
// From IProcess
MOCK_METHOD1(SetFlags,
void(int));
MOCK_METHOD0(GetFlags,
int(void));
// From I3DEngine
MOCK_METHOD0(Init,
bool());
MOCK_METHOD1(SetLevelPath,
void(const char* szFolderName));
MOCK_METHOD1(CheckMinSpec,
bool(uint32 nMinSpec));
MOCK_METHOD1(PrepareOcclusion,
void(const CCamera& rCamera));
MOCK_METHOD0(EndOcclusion,
void());
MOCK_METHOD2(LoadLevel,
bool(const char* szFolderName, const char* szMissionName));
MOCK_METHOD2(InitLevelForEditor,
bool(const char* szFolderName, const char* szMissionName));
MOCK_METHOD0(LevelLoadingInProgress,
bool());
MOCK_METHOD0(OnFrameStart,
void());
MOCK_METHOD0(PostLoadLevel,
void());
MOCK_METHOD0(LoadEmptyLevel,
void());
MOCK_METHOD0(UnloadLevel,
void());
MOCK_METHOD0(Update,
void());
MOCK_CONST_METHOD0(GetRenderingCamera,
const CCamera&());
MOCK_CONST_METHOD0(GetZoomFactor,
float());
MOCK_METHOD0(Tick,
void());
MOCK_METHOD0(UpdateShaderItems,
void());
MOCK_METHOD0(Release,
void());
MOCK_METHOD3(RenderWorld,
void(const int nRenderFlags, const SRenderingPassInfo& passInfo, const char* szDebugName));
MOCK_METHOD2(RenderSceneReflection,
void(const int nRenderFlags, const SRenderingPassInfo& passInfo));
MOCK_METHOD1(PreWorldStreamUpdate,
void(const CCamera& cam));
MOCK_METHOD0(WorldStreamUpdate,
void());
MOCK_METHOD0(ShutDown,
void());
MOCK_METHOD7(LoadStatObjUnsafeManualRef,
IStatObj*(const char* fileName, const char* geomName, IStatObj::SSubObject** subObject,
bool useStreaming, unsigned long loadingFlags, const void* data, int dataSize));
MOCK_METHOD7(LoadStatObjAutoRef,
_smart_ptr<IStatObj>(const char* fileName, const char* geomName, IStatObj::SSubObject** subObject,
bool useStreaming, unsigned long loadingFlags, const void* data, int dataSize));
MOCK_METHOD0(ProcessAsyncStaticObjectLoadRequests,
void());
MOCK_METHOD5(LoadStatObjAsync,
void(LoadStaticObjectAsyncResult resultCallback, const char* szFileName, const char* szGeomName, bool bUseStreaming, unsigned long nLoadingFlags));
MOCK_METHOD1(FindStatObjectByFilename,
IStatObj*(const char* filename));
MOCK_METHOD0(GetGSMRange,
const float());
MOCK_METHOD0(GetGSMRangeStep,
const float());
MOCK_METHOD0(GetLoadedObjectCount,
int());
MOCK_METHOD2(GetLoadedStatObjArray,
void(IStatObj** pObjectsArray, int& nCount));
MOCK_METHOD1(GetObjectsStreamingStatus,
void(SObjectsStreamingStatus& outStatus));
MOCK_METHOD2(GetStreamingSubsystemData,
void(int subsystem, SStremaingBandwidthData& outData));
MOCK_METHOD3(RegisterEntity,
void(IRenderNode* pEntity, int nSID, int nSIDConsideredSafe));
MOCK_METHOD1(SelectEntity,
void(IRenderNode* pEntity));
MOCK_METHOD0(IsSunShadows,
bool());
MOCK_METHOD2(MakeSystemMaterialFromShaderHelper
, _smart_ptr<IMaterial>(const char* sShaderName, SInputShaderResources* Res));
MOCK_METHOD1(CheckMinSpecHelper
, bool(uint32 nMinSpec));
MOCK_METHOD1(OnCasterDeleted
, void(IShadowCaster* pCaster));
MOCK_METHOD4(GetStatObjAndMatTables,
void(DynArray<IStatObj*>* pStatObjTable, DynArray<_smart_ptr<IMaterial>>* pMatTable, DynArray<IStatInstGroup*>* pStatInstGroupTable, uint32 nObjTypeMask));
#ifndef _RELEASE
MOCK_METHOD1(AddObjToDebugDrawList,
void(SObjectInfoToAddToDebugDrawList& objInfo));
MOCK_CONST_METHOD0(IsDebugDrawListEnabled,
bool());
#endif
MOCK_METHOD1(UnRegisterEntityDirect,
void(IRenderNode* pEntity));
MOCK_METHOD1(UnRegisterEntityAsJob,
void(IRenderNode* pEnt));
MOCK_CONST_METHOD1(IsUnderWater,
bool(const Vec3& vPos));
MOCK_METHOD1(SetOceanRenderFlags,
void(uint8 nFlags));
MOCK_CONST_METHOD0(GetOceanRenderFlags,
uint8());
MOCK_CONST_METHOD0(GetOceanVisiblePixelsCount,
uint32());
MOCK_METHOD3(GetBottomLevel,
float(const Vec3& referencePos, float maxRelevantDepth, int objtypes));
MOCK_METHOD2(GetBottomLevel,
float(const Vec3& referencePos, float maxRelevantDepth));
MOCK_METHOD2(GetBottomLevel,
float(const Vec3& referencePos, int objflags));
MOCK_METHOD0(GetWaterLevel,
float());
MOCK_METHOD3(GetWaterLevel,
float(const Vec3* pvPos, IPhysicalEntity* pent, bool bAccurate));
MOCK_CONST_METHOD1(GetAccurateOceanHeight,
float(const Vec3& pCurrPos));
MOCK_CONST_METHOD0(GetCausticsParams,
CausticsParams());
MOCK_CONST_METHOD0(GetOceanAnimationParams,
OceanAnimationData());
MOCK_CONST_METHOD1(GetHDRSetupParams,
void(Vec4 pParams[5]));
MOCK_METHOD0(ResetParticlesAndDecals,
void());
MOCK_METHOD1(CreateDecal,
void(const CryEngineDecalInfo& Decal));
MOCK_METHOD2(DeleteDecalsInRange,
void(AABB* pAreaBox, IRenderNode* pEntity));
MOCK_METHOD1(SetSunColor,
void(Vec3 vColor));
MOCK_METHOD0(GetSunAnimColor,
Vec3());
MOCK_METHOD1(SetSunAnimColor,
void(const Vec3& color));
MOCK_METHOD0(GetSunAnimSpeed,
float());
MOCK_METHOD1(SetSunAnimSpeed,
void(float sunAnimSpeed));
MOCK_METHOD0(GetSunAnimPhase,
AZ::u8());
MOCK_METHOD1(SetSunAnimPhase,
void(AZ::u8 sunAnimPhase));
MOCK_METHOD0(GetSunAnimIndex,
AZ::u8());
MOCK_METHOD1(SetSunAnimIndex,
void(AZ::u8 sunAnimIndex));
MOCK_METHOD1(SetRainParams,
void(const SRainParams& rainParams));
MOCK_METHOD1(GetRainParams,
bool(SRainParams& rainParams));
MOCK_METHOD5(SetSnowSurfaceParams,
void(const Vec3& vCenter, float fRadius, float fSnowAmount, float fFrostAmount, float fSurfaceFreezing));
MOCK_METHOD5(GetSnowSurfaceParams,
bool(Vec3& vCenter, float& fRadius, float& fSnowAmount, float& fFrostAmount, float& fSurfaceFreezing));
MOCK_METHOD7(SetSnowFallParams,
void(int nSnowFlakeCount, float fSnowFlakeSize, float fSnowFallBrightness, float fSnowFallGravityScale, float fSnowFallWindScale, float fSnowFallTurbulence, float fSnowFallTurbulenceFreq));
MOCK_METHOD7(GetSnowFallParams,
bool(int& nSnowFlakeCount, float& fSnowFlakeSize, float& fSnowFallBrightness, float& fSnowFallGravityScale, float& fSnowFallWindScale, float& fSnowFallTurbulence, float& fSnowFallTurbulenceFreq));
MOCK_METHOD1(SetMaxViewDistanceScale,
void(float fScale));
MOCK_METHOD1(GetMaxViewDistance,
float(bool));
MOCK_CONST_METHOD0(GetFrameLodInfo,
const SFrameLodInfo&());
MOCK_METHOD1(SetFrameLodInfo,
void(const SFrameLodInfo& frameLodInfo));
MOCK_METHOD1(SetFogColor,
void(const Vec3& vFogColor));
MOCK_METHOD0(GetFogColor,
Vec3());
MOCK_METHOD6(GetSkyLightParameters,
void(Vec3& sunDir, Vec3& sunIntensity, float& Km, float& Kr, float& g, Vec3& rgbWaveLengths));
MOCK_METHOD7(SetSkyLightParameters,
void(const Vec3& sunDir, const Vec3& sunIntensity, float Km, float Kr, float g, const Vec3& rgbWaveLengths, bool forceImmediateUpdate));
MOCK_CONST_METHOD0(GetLightsHDRDynamicPowerFactor,
float());
MOCK_CONST_METHOD3(IsTessellationAllowed,
bool(const CRenderObject* pObj, const SRenderingPassInfo& passInfo, bool bIgnoreShadowPass));
MOCK_METHOD3(SetRenderNodeMaterialAtPosition,
void(EERType eNodeType, const Vec3& vPos, _smart_ptr<IMaterial> pMat));
MOCK_METHOD1(OverrideCameraPrecachePoint,
void(const Vec3& vPos));
MOCK_METHOD4(AddPrecachePoint,
int(const Vec3& vPos, const Vec3& vDir, float fTimeOut, float fImportanceFactor));
MOCK_METHOD1(ClearPrecachePoint,
void(int id));
MOCK_METHOD0(ClearAllPrecachePoints,
void());
MOCK_METHOD1(GetPrecacheRoundIds,
void(int pRoundIds[MAX_STREAM_PREDICTION_ZONES]));
MOCK_METHOD5(TraceFogVolumes,
void(const Vec3& vPos, const AABB& objBBox, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality));
MOCK_METHOD1(RemoveAllStaticObjects,
void(int));
MOCK_METHOD3(SetStatInstGroup,
bool(int nGroupId, const IStatInstGroup& siGroup, int nSID));
MOCK_METHOD3(GetStatInstGroup,
bool(int, IStatInstGroup&, int));
MOCK_METHOD3(OnExplosion,
void(Vec3, float, bool));
MOCK_METHOD1(SetPhysMaterialEnumerator,
void(IPhysMaterialEnumerator* pPhysMaterialEnumerator));
MOCK_METHOD0(GetPhysMaterialEnumerator,
IPhysMaterialEnumerator*());
MOCK_METHOD0(SetupDistanceFog,
void());
MOCK_METHOD1(LoadMissionDataFromXMLNode,
void(const char* szMissionName));
MOCK_METHOD2(LoadEnvironmentSettingsFromXML,
void(XmlNodeRef, int));
MOCK_METHOD0(LoadCompiledOctreeForEditor,
bool());
MOCK_CONST_METHOD0(GetSunDir,
Vec3());
MOCK_CONST_METHOD0(GetSunDirNormalized,
Vec3());
MOCK_CONST_METHOD0(GetRealtimeSunDirNormalized,
Vec3());
MOCK_METHOD0(GetDistanceToSectorWithWater,
float());
MOCK_CONST_METHOD0(GetSunColor,
Vec3());
MOCK_CONST_METHOD0(GetSSAOAmount,
float());
MOCK_CONST_METHOD0(GetSSAOContrast,
float());
MOCK_METHOD1(FreeRenderNodeState,
void(IRenderNode* pEntity));
MOCK_METHOD1(GetLevelFilePath,
const char*(const char* szFileName));
MOCK_METHOD4(DisplayInfo,
void(float& fTextPosX, float& fTextPosY, float& fTextStepY, const bool bEnhanced));
MOCK_METHOD0(DisplayMemoryStatistics,
void());
// Can't mock methods with variable parameters so just create empty bodies for them.
void DrawTextRightAligned([[maybe_unused]] const float x, [[maybe_unused]] const float y, [[maybe_unused]] const char* format, ...) override {}
void DrawTextRightAligned([[maybe_unused]] const float x, [[maybe_unused]] const float y, [[maybe_unused]] const float scale, [[maybe_unused]] const ColorF& color, [[maybe_unused]] const char* format, ...) override {}
MOCK_METHOD3(DrawBBoxHelper
, void (const Vec3& vMin, const Vec3& vMax, ColorB col));
MOCK_METHOD2(DrawBBoxHelper
, void (const AABB& box, ColorB col));
MOCK_METHOD3(ActivatePortal,
void(const Vec3& vPos, bool bActivate, const char* szEntityName));
MOCK_CONST_METHOD1(GetMemoryUsage,
void(ICrySizer* pSizer));
MOCK_METHOD2(GetResourceMemoryUsage,
void(ICrySizer* pSizer, const AABB& cstAABB));
MOCK_METHOD1(CreateVisArea,
IVisArea*(uint64 visGUID));
MOCK_METHOD1(DeleteVisArea,
void(IVisArea* pVisArea));
MOCK_METHOD6(UpdateVisArea,
void(IVisArea* pArea, const Vec3* pPoints, int nCount, const char* szName, const SVisAreaInfo& info, bool bReregisterObjects));
MOCK_METHOD4(IsVisAreasConnected,
bool(IVisArea* pArea1, IVisArea* pArea2, int nMaxRecursion, bool bSkipDisabledPortals));
MOCK_METHOD0(CreateClipVolume,
IClipVolume*());
MOCK_METHOD1(DeleteClipVolume,
void(IClipVolume* pClipVolume));
MOCK_METHOD7(UpdateClipVolume,
void(IClipVolume* pClipVolume, _smart_ptr<IRenderMesh> pRenderMesh, IBSPTree3D* pBspTree, const Matrix34& worldTM, bool bActive, uint32 flags, const char* szName));
MOCK_METHOD1(CreateRenderNode,
IRenderNode*(EERType type));
MOCK_METHOD1(DeleteRenderNode,
void(IRenderNode* pRenderNode));
MOCK_METHOD1(SetWind,
void(const Vec3& vWind));
MOCK_CONST_METHOD2(GetWind,
Vec3(const AABB& box, bool bIndoors));
MOCK_CONST_METHOD1(GetGlobalWind,
Vec3(bool bIndoors));
MOCK_CONST_METHOD4(SampleWind,
bool(Vec3* pSamples, int nSamples, const AABB& volume, bool bIndoors));
MOCK_METHOD1(GetVisAreaFromPos,
IVisArea*(const Vec3& vPos));
MOCK_METHOD2(IntersectsVisAreas,
bool(const AABB& box, void** pNodeCache));
MOCK_METHOD4(ClipToVisAreas,
bool(IVisArea* pInside, Sphere& sphere, Vec3 const& vNormal, void* pNodeCache));
MOCK_METHOD1(EnableOceanRendering,
void(bool bOcean));
MOCK_METHOD1(AddTextureLoadHandler,
void(ITextureLoadHandler* pHandler));
MOCK_METHOD1(RemoveTextureLoadHandler,
void(ITextureLoadHandler* pHandler));
MOCK_METHOD1(GetTextureLoadHandlerForImage,
ITextureLoadHandler*(const char* ext));
MOCK_METHOD0(CreateLightSource,
struct ILightSource*());
MOCK_METHOD1(DeleteLightSource,
void(ILightSource* pLightSource));
MOCK_METHOD0(GetLightEntities,
const PodArray<ILightSource*>* ());
MOCK_METHOD3(GetLightVolumes,
void(threadID nThreadID, SLightVolume*& pLightVols, uint32& nNumVols));
MOCK_METHOD4(RegisterVolumeForLighting,
uint16(const Vec3& vPos, f32 fRadius, uint8 nClipVolumeRef, const SRenderingPassInfo& passInfo));
MOCK_METHOD1(RestoreTerrainFromDisk,
bool(int));
MOCK_METHOD1(GetFilePath,
const char*(const char* szFileName));
MOCK_CONST_METHOD0(GetPostEffectGroups,
class IPostEffectGroupManager*());
MOCK_CONST_METHOD0(GetPostEffectBaseGroup,
class IPostEffectGroup*());
MOCK_CONST_METHOD3(SetPostEffectParam,
void(const char* pParam, float fValue, bool bForceValue));
MOCK_CONST_METHOD3(SetPostEffectParamVec4,
void(const char* pParam, const Vec4& pValue, bool bForceValue));
MOCK_CONST_METHOD2(SetPostEffectParamString,
void(const char* pParam, const char* pszArg));
MOCK_CONST_METHOD2(GetPostEffectParam,
void(const char* pParam, float& fValue));
MOCK_CONST_METHOD2(GetPostEffectParamVec4,
void(const char* pParam, Vec4& pValue));
MOCK_CONST_METHOD2(GetPostEffectParamString,
void(const char* pParam, const char*& pszArg));
MOCK_METHOD1(GetPostEffectID,
int32(const char* pPostEffectName));
MOCK_METHOD1(ResetPostEffects,
void(bool));
MOCK_METHOD0(DisablePostEffects,
void());
MOCK_METHOD1(SetShadowsGSMCache,
void(bool bCache));
MOCK_METHOD2(SetCachedShadowBounds,
void(const AABB& shadowBounds, float fAdditionalCascadesScale));
MOCK_METHOD1(SetRecomputeCachedShadows,
void(uint));
MOCK_METHOD0(CheckMemoryHeap,
void());
MOCK_METHOD1(DeleteEntityDecals,
void(IRenderNode* pEntity));
MOCK_METHOD0(LockCGFResources,
void());
MOCK_METHOD0(UnlockCGFResources,
void());
MOCK_METHOD0(FreeUnusedCGFResources,
void());
MOCK_METHOD0(CreateStatObj,
IStatObj*());
MOCK_METHOD1(CreateStatObjOptionalIndexedMesh,
IStatObj*(bool createIndexedMesh));
MOCK_METHOD0(CreateIndexedMesh,
IIndexedMesh*());
MOCK_METHOD1(SerializeState,
void(TSerialize ser));
MOCK_METHOD1(PostSerialize,
void(bool bReading));
MOCK_METHOD0(GetMaterialHelpers,
IMaterialHelpers&());
MOCK_METHOD0(GetMaterialManager,
IMaterialManager*());
MOCK_METHOD0(GetObjManager,
IObjManager*());
MOCK_METHOD1(CreateChunkfileContent,
CContentCGF*(const char* filename));
MOCK_METHOD1(ReleaseChunkfileContent,
void(CContentCGF*));
MOCK_METHOD4(LoadChunkFileContent,
bool(CContentCGF* pCGF, const char* filename, bool bNoWarningMode, bool bCopyChunkFile));
MOCK_METHOD6(LoadChunkFileContentFromMem,
bool(CContentCGF* pCGF, const void* pData, size_t nDataLen, uint32 nLoadingFlags, bool bNoWarningMode, bool bCopyChunkFile));
MOCK_METHOD1(CreateChunkFile,
IChunkFile*(bool));
MOCK_CONST_METHOD3(CreateChunkFileWriter,
ChunkFile::IChunkFileWriter*(EChunkFileFormat eFormat, AZ::IO::IArchive* pPak, const char* filename));
MOCK_CONST_METHOD1(ReleaseChunkFileWriter,
void(ChunkFile::IChunkFileWriter* p));
MOCK_METHOD2(CreateOcean,
bool(_smart_ptr<IMaterial> pTerrainWaterMat, float waterLevel));
MOCK_METHOD0(DeleteOcean,
void());
MOCK_METHOD1(ChangeOceanMaterial,
void(_smart_ptr<IMaterial> pMat));
MOCK_METHOD1(ChangeOceanWaterLevel,
void(float fWaterLevel));
MOCK_METHOD1(InitMaterialDefautMappingAxis
, void(_smart_ptr<IMaterial> pMat));
MOCK_METHOD0(GetIVisAreaManager,
IVisAreaManager*());
MOCK_METHOD3(PrecacheLevel,
void(bool bPrecacheAllVisAreas, Vec3* pPrecachePoints, int nPrecachePointsNum));
MOCK_METHOD0(ProposeContentPrecache,
void());
MOCK_METHOD0(GetTimeOfDay,
ITimeOfDay*());
MOCK_METHOD1(SetSkyMaterialPath,
void(const string& skyMaterialPath));
MOCK_METHOD1(SetSkyLowSpecMaterialPath,
void(const string& skyMaterialPath));
MOCK_METHOD0(LoadSkyMaterial,
void());
MOCK_METHOD0(GetSkyMaterial,
_smart_ptr<IMaterial>());
MOCK_METHOD1(SetSkyMaterial,
void(_smart_ptr<IMaterial> pSkyMat));
MOCK_METHOD2(SetGlobalParameter,
void(E3DEngineParameter param, const Vec3& v));
MOCK_METHOD2(GetGlobalParameter,
void(E3DEngineParameter param, Vec3& v));
MOCK_METHOD1(SetShadowMode,
void(EShadowMode shadowMode));
MOCK_CONST_METHOD0(GetShadowMode,
EShadowMode());
MOCK_METHOD6(AddPerObjectShadow,
void(IShadowCaster* pCaster, float fConstBias, float fSlopeBias, float fJitter, const Vec3& vBBoxScale, uint nTexSize));
MOCK_METHOD1(RemovePerObjectShadow,
void(IShadowCaster* pCaster));
MOCK_METHOD1(GetPerObjectShadow,
struct SPerObjectShadow*(IShadowCaster* pCaster));
MOCK_METHOD2(GetCustomShadowMapFrustums,
void(struct ShadowMapFrustum*& arrFrustums, int& nFrustumCount));
MOCK_METHOD2(SaveStatObj,
int(IStatObj* pStatObj, TSerialize ser));
MOCK_METHOD1(LoadStatObj,
IStatObj*(TSerialize ser));
MOCK_METHOD2(CheckIntersectClouds,
bool(const Vec3& p1, const Vec3& p2));
MOCK_METHOD1(OnRenderMeshDeleted,
void(IRenderMesh* pRenderMesh));
MOCK_METHOD0(DebugDraw_UpdateDebugNode,
void());
MOCK_METHOD4(RayObjectsIntersection2D,
bool(Vec3 vStart, Vec3 vEnd, Vec3& vHitPoint, EERType eERType));
MOCK_METHOD3(RenderMeshRayIntersection,
bool(IRenderMesh* pRenderMesh, SRayHitInfo& hitInfo, _smart_ptr<IMaterial> pCustomMtl));
MOCK_METHOD3(CheckCreateRNTmpData
, void(CRNTmpData** ppInfo, IRenderNode* pRNode, const SRenderingPassInfo& passInfo));
MOCK_METHOD1(FreeRNTmpData,
void(CRNTmpData** ppInfo));
MOCK_METHOD0(IsObjectTreeReady
, bool());
MOCK_METHOD0(GetIObjectTree
, IOctreeNode*());
MOCK_METHOD2(GetObjectsByType,
uint32(EERType, IRenderNode**));
MOCK_METHOD4(GetObjectsByTypeInBox,
uint32(EERType objType, const AABB& bbox, IRenderNode** pObjects, ObjectTreeQueryFilterCallback filterCallback));
MOCK_METHOD2(GetObjectsInBox,
uint32(const AABB& bbox, IRenderNode** pObjects));
MOCK_METHOD2(GetObjectsByFlags,
uint32(uint, IRenderNode**));
MOCK_METHOD4(GetObjectsByTypeInBox,
void(EERType objType, const AABB& bbox, PodArray<IRenderNode*>* pLstObjects, ObjectTreeQueryFilterCallback filterCallback));
MOCK_METHOD2(OnObjectModified,
void(IRenderNode* pRenderNode, uint dwFlags));
MOCK_METHOD1(FillDebugFPSInfo,
void(SDebugFPSInfo&));
MOCK_METHOD0(GetLevelFolder,
const char*());
MOCK_METHOD0(IsAreaActivationInUse,
bool());
MOCK_METHOD3(RenderRenderNode_ShadowPass,
void(IShadowCaster* pRNode, const SRenderingPassInfo& passInfo, AZ::LegacyJobExecutor* pJobExecutor));
MOCK_METHOD0(GetOpticsManager,
IOpticsManager*());
MOCK_METHOD0(SyncProcessStreamingUpdate,
void());
MOCK_METHOD1(SetScreenshotCallback,
void(IScreenshotCallback* pCallback));
MOCK_METHOD8(ActivateObjectsLayer,
void(uint16 nLayerId, bool bActivate, bool bPhys, bool bObjects, bool bStaticLights, const char* pLayerName, IGeneralMemoryHeap* pHeap, bool bCheckLayerActivation));
MOCK_CONST_METHOD4(GetLayerMemoryUsage,
void(uint16 nLayerId, ICrySizer* pSizer, int* pNumBrushes, int* pNumDecals));
MOCK_METHOD2(SkipLayerLoading,
void(uint16 nLayerId, bool bClearList));
MOCK_METHOD2(PrecacheRenderNode,
void(IRenderNode* pObj, float fEntDistanceReal));
MOCK_METHOD0(GetDeferredPhysicsEventManager,
IDeferredPhysicsEventManager*());
MOCK_METHOD1(SetStreamableListener,
void(IStreamedObjectListener* pListener));
MOCK_METHOD1(GetRenderingPassCamera,
CCamera*(const CCamera& rCamera));
MOCK_METHOD3(GetSvoStaticTextures,
void(I3DEngine::SSvoStaticTexInfo& svoInfo, PodArray<I3DEngine::SLightTI>* pLightsTI_S, PodArray<I3DEngine::SLightTI>* pLightsTI_D));
MOCK_METHOD2(GetSvoBricksForUpdate,
void(PodArray<SSvoNodeInfo>& arrNodeInfo, bool getDynamic));
#if defined(USE_GEOM_CACHES)
MOCK_METHOD1(LoadGeomCache,
IGeomCache*(const char* szFileName));
MOCK_METHOD1(FindGeomCacheByFilename,
IGeomCache*(const char* szFileName));
#endif
MOCK_METHOD3(LoadDesignerObject,
IStatObj*(int nVersion, const char* szBinaryStream, int size));
MOCK_METHOD0(WaitForCullingJobsCompletion,
void());
};
@@ -0,0 +1,63 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <IAudioSystem.h>
namespace Audio
{
struct AudioProxyMock
: public IAudioProxy
{
MOCK_METHOD2(Initialize, void(const char* const sObjectName, const bool bInitAsync /* = true */));
MOCK_METHOD0(Release, void());
MOCK_METHOD0(Reset, void());
MOCK_METHOD1(StopTrigger, void(const TAudioControlID nTriggerID));
MOCK_METHOD2(SetSwitchState, void(const TAudioControlID nSwitchID, const TAudioSwitchStateID nStateID));
MOCK_METHOD2(SetRtpcValue, void(const TAudioControlID nRtpcID, const float fValue));
MOCK_METHOD1(SetObstructionCalcType, void(const EAudioObjectObstructionCalcType eObstructionType));
MOCK_METHOD1(SetPosition, void(const SATLWorldPosition& rPosition));
MOCK_METHOD1(SetPosition, void(const AZ::Vector3& rPosition));
MOCK_METHOD2(SetEnvironmentAmount, void(const TAudioEnvironmentID nEnvironmentID, const float fAmount));
MOCK_METHOD0(SetCurrentEnvironments, void());
MOCK_CONST_METHOD0(GetAudioObjectID, TAudioObjectID());
};
struct AudioSystemMock
: public IAudioSystem
{
MOCK_METHOD0(Initialize, bool());
MOCK_METHOD0(Release, void());
MOCK_METHOD1(PushRequest, void(const SAudioRequest& rAudioRequestData));
MOCK_METHOD4(AddRequestListener, void(AudioRequestCallbackType func, void* const pObjectToListenTo, const EAudioRequestType requestType /* = eART_AUDIO_ALL_REQUESTS */, const TATLEnumFlagsType specificRequestMask /* = ALL_AUDIO_REQUEST_SPECIFIC_TYPE_FLAGS */));
MOCK_METHOD2(RemoveRequestListener, void(AudioRequestCallbackType func, void* const pObjectToListenTo));
MOCK_METHOD0(ExternalUpdate, void());
MOCK_CONST_METHOD1(GetAudioTriggerID, TAudioControlID(const char* const sAudioTriggerName));
MOCK_CONST_METHOD1(GetAudioRtpcID, TAudioControlID(const char* const sAudioRtpcName));
MOCK_CONST_METHOD1(GetAudioSwitchID, TAudioControlID(const char* const sAudioSwitchName));
MOCK_CONST_METHOD2(GetAudioSwitchStateID, TAudioSwitchStateID(const TAudioControlID nSwitchID, const char* const sAudioStateName));
MOCK_CONST_METHOD1(GetAudioPreloadRequestID, TAudioPreloadRequestID(const char* const sAudioPreloadRequestName));
MOCK_CONST_METHOD1(GetAudioEnvironmentID, TAudioEnvironmentID(const char* const sAudioEnvironmentName));
MOCK_METHOD1(ReserveAudioListenerID, bool(TAudioObjectID& rAudioListenerID));
MOCK_METHOD1(ReleaseAudioListenerID, bool(const TAudioObjectID nAudioObjectID));
MOCK_METHOD1(OnCVarChanged, void(ICVar* const pCVar));
MOCK_METHOD1(GetInfo, void(SAudioSystemInfo& rAudioSystemInfo));
MOCK_CONST_METHOD0(GetControlsPath, const char*());
MOCK_METHOD0(UpdateControlsPath, void());
MOCK_METHOD0(GetFreeAudioProxy, IAudioProxy*());
MOCK_METHOD1(FreeAudioProxy, void(IAudioProxy* const pIAudioProxy));
MOCK_CONST_METHOD2(GetAudioControlName, const char*(const EAudioControlType eAudioEntityType, const TATLIDType nAudioEntityID));
MOCK_CONST_METHOD2(GetAudioSwitchStateName, const char*(const TAudioControlID switchID, const TAudioSwitchStateID stateID));
};
} // namespace Audio
@@ -0,0 +1,53 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <IConsole.h>
#include <AzTest/AzTest.h>
#include <SFunctor.h>
class CVarMock
: public ICVar
{
public:
MOCK_METHOD0(Release, void());
MOCK_CONST_METHOD0(GetIVal, int());
MOCK_CONST_METHOD0(GetI64Val, int64());
MOCK_CONST_METHOD0(GetFVal, float());
MOCK_CONST_METHOD0(GetString, const char*());
MOCK_CONST_METHOD0(GetDataProbeString, const char*());
MOCK_METHOD1(Set, void(const char*));
MOCK_METHOD1(ForceSet, void(const char*));
MOCK_METHOD1(Set, void(const float));
MOCK_METHOD1(Set, void(const int));
MOCK_METHOD1(ClearFlags, void(const int));
MOCK_CONST_METHOD0(GetFlags, int());
MOCK_METHOD1(SetFlags, int(const int));
MOCK_METHOD0(GetType, int());
MOCK_CONST_METHOD0(GetName, const char*());
MOCK_METHOD0(GetHelp, const char*());
MOCK_CONST_METHOD0(IsConstCVar, bool());
MOCK_METHOD1(SetOnChangeCallback, void(ConsoleVarFunc));
MOCK_METHOD1(AddOnChangeFunctor, uint64(const SFunctor& pChangeFunctor));
MOCK_CONST_METHOD0(GetNumberOfOnChangeFunctors, uint64());
MOCK_CONST_METHOD1(GetOnChangeFunctor, const SFunctor&(uint64));
MOCK_METHOD1(RemoveOnChangeFunctor, bool(uint64));
MOCK_CONST_METHOD0(GetOnChangeCallback, ConsoleVarFunc());
MOCK_CONST_METHOD1(GetMemoryUsage, void(class ICrySizer* pSizer));
MOCK_CONST_METHOD0(GetRealIVal, int());
MOCK_METHOD2(SetLimits, void(float, float));
MOCK_METHOD2(GetLimits, void(float&, float&));
MOCK_METHOD0(HasCustomLimits, bool());
MOCK_METHOD1(SetDataProbeString, void(const char*));
};
@@ -0,0 +1,96 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef CRYINCLUDE_CRYCOMMON_ICONSOLEMOCK_H
#define CRYINCLUDE_CRYCOMMON_ICONSOLEMOCK_H
#pragma once
#include <IRemoteCommand.h>
#include <IConsole.h>
#include <AzTest/AzTest.h>
// Implements the Console interface
class ConsoleMock
: public ::IConsole
{
public:
MOCK_METHOD0(Release, void());
MOCK_METHOD1(Init, void(ISystem * pSystem));
MOCK_METHOD5(RegisterString, ICVar * (const char* sName, const char* sValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
MOCK_METHOD5(RegisterInt, ICVar * (const char* sName, int iValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
MOCK_METHOD5(RegisterInt64, ICVar * (const char* sName, int64 iValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
MOCK_METHOD5(RegisterFloat, ICVar * (const char* sName, float fValue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc));
MOCK_METHOD7(Register, ICVar * (const char* name, float* src, float defaultvalue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc, bool allowModify));
MOCK_METHOD7(Register, ICVar * (const char* name, int* src, int defaultvalue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc, bool allowModify));
MOCK_METHOD7(Register, ICVar * (const char* name, const char** src, const char* defaultvalue, int nFlags, const char* help, ConsoleVarFunc pChangeFunc, bool allowModify));
MOCK_METHOD1(Register, ICVar * (ICVar * pVar));
MOCK_METHOD2(UnregisterVariable, void(const char* sVarName, bool bDelete ));
MOCK_METHOD1(SetScrollMax, void(int value));
MOCK_METHOD1(AddOutputPrintSink, void(IOutputPrintSink * inpSink));
MOCK_METHOD1(RemoveOutputPrintSink, void(IOutputPrintSink * inpSink));
MOCK_METHOD2(ShowConsole, void(bool show, const int iRequestScrollMax));
MOCK_METHOD2(DumpCVars, void(ICVarDumpSink * pCallback, unsigned int nFlagsFilter));
MOCK_METHOD2(CreateKeyBind, void(const char* sCmd, const char* sRes));
MOCK_METHOD2(SetImage, void (ITexture * pImage, bool bDeleteCurrent));
MOCK_METHOD0(GetImage, ITexture * ());
MOCK_METHOD1(StaticBackground, void (bool bStatic));
MOCK_METHOD1(SetLoadingImage, void(const char* szFilename));
MOCK_CONST_METHOD3(GetLineNo, bool(const int indwLineNo, char* outszBuffer, const int indwBufferSize));
MOCK_CONST_METHOD0(GetLineCount, int ());
MOCK_METHOD1(GetCVar, ICVar * (const char* name));
MOCK_METHOD3(GetVariable, char*(const char* szVarName, const char* szFileName, const char* def_val));
MOCK_METHOD3(GetVariable, float (const char* szVarName, const char* szFileName, float def_val));
MOCK_METHOD1(PrintLine, void (const char* s));
MOCK_METHOD1(PrintLinePlus, void (const char* s));
MOCK_METHOD0(GetStatus, bool());
MOCK_METHOD0(Clear, void());
MOCK_METHOD0(Update, void());
MOCK_METHOD0(Draw, void());
MOCK_METHOD4(AddCommand, bool (const char* sCommand, ConsoleCommandFunc func, int nFlags, const char* sHelp));
MOCK_METHOD4(AddCommand, bool (const char* sName, const char* sScriptFunc, int nFlags, const char* sHelp));
MOCK_METHOD1(RemoveCommand, void (const char* sName));
MOCK_METHOD3(ExecuteString, void (const char* command, const bool bSilentMode, const bool bDeferExecution ));
MOCK_METHOD0(IsOpened, bool ());
MOCK_METHOD0(GetNumVars, int());
MOCK_METHOD0(GetNumVisibleVars, int());
MOCK_METHOD3(GetSortedVars, size_t (const char** pszArray, size_t numItems, const char* szPrefix));
MOCK_METHOD1(AutoComplete, const char*(const char* substr));
MOCK_METHOD1(AutoCompletePrev, const char*(const char* substr));
MOCK_METHOD1(ProcessCompletion, const char*(const char* szInputBuffer));
MOCK_METHOD2(RegisterAutoComplete, void (const char* sVarOrCommand, IConsoleArgumentAutoComplete * pArgAutoComplete));
MOCK_METHOD1(UnRegisterAutoComplete, void (const char* sVarOrCommand));
MOCK_METHOD0(ResetAutoCompletion, void ());
MOCK_CONST_METHOD1(GetMemoryUsage, void (ICrySizer * pSizer));
MOCK_METHOD1(ResetProgressBar, void (int nProgressRange));
MOCK_METHOD0(TickProgressBar, void ());
MOCK_METHOD1(SetInputLine, void (const char* szLine));
MOCK_METHOD1(DumpKeyBinds, void (IKeyBindDumpSink * pCallback));
MOCK_CONST_METHOD1(FindKeyBind, const char*(const char* sCmd));
MOCK_METHOD0(GetNumCheatVars, int ());
MOCK_METHOD2(SetCheatVarHashRange, void (size_t firstVar, size_t lastVar));
MOCK_METHOD0(CalcCheatVarHash, void ());
MOCK_METHOD0(IsHashCalculated, bool ());
MOCK_METHOD0(GetCheatVarHash, uint64 ());
MOCK_METHOD1(PrintCheatVars, void (bool bUseLastHashRange));
MOCK_METHOD1(GetCheatVarAt, char* (uint32 nOffset));
MOCK_METHOD1(AddConsoleVarSink, void (IConsoleVarSink * pSink));
MOCK_METHOD1(RemoveConsoleVarSink, void (IConsoleVarSink * pSink));
MOCK_METHOD1(GetHistoryElement, const char*(const bool bUpOrDown));
MOCK_METHOD1(AddCommandToHistory, void (const char* szCommand));
MOCK_METHOD2(LoadConfigVar, void (const char* sVariable, const char* sValue));
MOCK_METHOD1(EnableActivationKey, void (bool bEnable));
MOCK_METHOD2(SetClientDataProbeString, void (const char* pName, const char* pValue));
// can't mock variadic methods, so just override here.
void Exit([[maybe_unused]] const char* command, ...) override {};
};
#endif // CRYINCLUDE_CRYCOMMON_ICONSOLEMOCK_H
@@ -0,0 +1,107 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzTest/AzTest.h>
#include <AzCore/IO/FileIO.h>
#include <AzFramework/Archive/INestedArchive.h>
#include <AzFramework/Archive/IArchive.h>
struct CryPakMock
: AZ::IO::IArchive
{
MOCK_METHOD5(AdjustFileName, const char*(AZStd::string_view src, char* dst, size_t dstSize, uint32_t nFlags, bool skipMods));
MOCK_METHOD1(Init, bool(AZStd::string_view szBasePath));
MOCK_METHOD0(Release, void());
MOCK_CONST_METHOD1(IsInstalledToHDD, bool(AZStd::string_view acFilePath));
MOCK_METHOD5(OpenPack, bool(AZStd::string_view, uint32_t, AZStd::intrusive_ptr<AZ::IO::MemoryBlock>, AZStd::fixed_string<AZ::IO::IArchive::MaxPath>*, bool));
MOCK_METHOD6(OpenPack, bool(AZStd::string_view, AZStd::string_view, uint32_t, AZStd::intrusive_ptr<AZ::IO::MemoryBlock>, AZStd::fixed_string<AZ::IO::IArchive::MaxPath>*, bool));
MOCK_METHOD3(OpenPacks, bool(AZStd::string_view pWildcard, uint32_t nFlags, AZStd::vector<AZStd::fixed_string<AZ::IO::IArchive::MaxPath>>* pFullPaths));
MOCK_METHOD4(OpenPacks, bool(AZStd::string_view pBindingRoot, AZStd::string_view pWildcard, uint32_t nFlags, AZStd::vector<AZStd::fixed_string<AZ::IO::IArchive::MaxPath>>* pFullPaths));
MOCK_METHOD2(ClosePack, bool(AZStd::string_view pName, uint32_t nFlags));
MOCK_METHOD2(ClosePacks, bool(AZStd::string_view pWildcard, uint32_t nFlags));
MOCK_METHOD1(FindPacks, bool(AZStd::string_view pWildcardIn));
MOCK_METHOD3(SetPacksAccessible, bool(bool bAccessible, AZStd::string_view pWildcard, uint32_t nFlags));
MOCK_METHOD3(SetPackAccessible, bool(bool bAccessible, AZStd::string_view pName, uint32_t nFlags));
MOCK_METHOD3(LoadPakToMemory, bool(AZStd::string_view pName, EInMemoryArchiveLocation eLoadToMemory, AZStd::intrusive_ptr<AZ::IO::MemoryBlock> pMemoryBlock));
MOCK_METHOD2(LoadPaksToMemory, void(int nMaxPakSize, bool bLoadToMemory));
MOCK_METHOD1(GetMod, const char*(int index));
MOCK_METHOD1(ParseAliases, void(AZStd::string_view szCommandLine));
MOCK_METHOD3(SetAlias, void(AZStd::string_view szName, AZStd::string_view szAlias, bool bAdd));
MOCK_METHOD2(GetAlias, const char*(AZStd::string_view szName, bool bReturnSame));
MOCK_METHOD0(Lock, void());
MOCK_METHOD0(Unlock, void());
MOCK_METHOD1(SetLocalizationFolder, void(AZStd::string_view sLocalizationFolder));
MOCK_CONST_METHOD0(GetLocalizationFolder, const char*());
MOCK_CONST_METHOD0(GetLocalizationRoot, const char*());
MOCK_METHOD3(FOpen, AZ::IO::HandleType(AZStd::string_view pName, const char* mode, uint32_t nFlags));
MOCK_METHOD4(FReadRaw, size_t(void* data, size_t length, size_t elems, AZ::IO::HandleType handle));
MOCK_METHOD3(FReadRawAll, size_t(void* data, size_t nFileSize, AZ::IO::HandleType handle));
MOCK_METHOD2(FGetCachedFileData, void*(AZ::IO::HandleType handle, size_t & nFileSize));
MOCK_METHOD4(FWrite, size_t(const void* data, size_t length, size_t elems, AZ::IO::HandleType handle));
MOCK_METHOD3(FGets, char*(char*, int, AZ::IO::HandleType));
MOCK_METHOD1(Getc, int(AZ::IO::HandleType));
MOCK_METHOD1(FGetSize, size_t(AZ::IO::HandleType f));
MOCK_METHOD2(FGetSize, size_t(AZStd::string_view pName, bool bAllowUseFileSystem));
MOCK_METHOD1(IsInPak, bool(AZ::IO::HandleType handle));
MOCK_METHOD1(RemoveFile, bool(AZStd::string_view pName));
MOCK_METHOD1(RemoveDir, bool(AZStd::string_view pName));
MOCK_METHOD1(IsAbsPath, bool(AZStd::string_view pPath));
MOCK_METHOD3(FSeek, size_t(AZ::IO::HandleType handle, uint64_t seek, int mode));
MOCK_METHOD1(FTell, uint64_t(AZ::IO::HandleType handle));
MOCK_METHOD1(FClose, int(AZ::IO::HandleType handle));
MOCK_METHOD1(FEof, int(AZ::IO::HandleType handle));
MOCK_METHOD1(FFlush, int(AZ::IO::HandleType handle));
MOCK_METHOD1(PoolMalloc, void*(size_t size));
MOCK_METHOD1(PoolFree, void(void* p));
MOCK_METHOD3(PoolAllocMemoryBlock, AZStd::intrusive_ptr<AZ::IO::MemoryBlock> (size_t nSize, const char* sUsage, size_t nAlign));
MOCK_METHOD3(FindFirst, AZ::IO::ArchiveFileIterator(AZStd::string_view pDir, uint32_t nFlags, bool bAllOwUseFileSystem));
MOCK_METHOD1(FindNext, AZ::IO::ArchiveFileIterator(AZ::IO::ArchiveFileIterator handle));
MOCK_METHOD1(FindClose, bool(AZ::IO::ArchiveFileIterator));
MOCK_METHOD1(GetModificationTime, AZ::IO::IArchive::FileTime(AZ::IO::HandleType f));
MOCK_METHOD2(IsFileExist, bool(AZStd::string_view sFilename, EFileSearchLocation));
MOCK_METHOD1(IsFolder, bool(AZStd::string_view sPath));
MOCK_METHOD1(GetFileSizeOnDisk, AZ::IO::IArchive::SignedFileSize(AZStd::string_view filename));
MOCK_METHOD2(MakeDir, bool(AZStd::string_view szPath, bool bGamePathMapping));
MOCK_METHOD4(OpenArchive, AZStd::intrusive_ptr<AZ::IO::INestedArchive> (AZStd::string_view szPath, AZStd::string_view bindRoot, uint32_t nFlags, AZStd::intrusive_ptr<AZ::IO::MemoryBlock> pData));
MOCK_METHOD1(GetFileArchivePath, const char* (AZ::IO::HandleType f));
MOCK_METHOD5(RawCompress, int(const void* pUncompressed, size_t* pDestSize, void* pCompressed, size_t nSrcSize, int nLevel));
MOCK_METHOD4(RawUncompress, int(void* pUncompressed, size_t* pDestSize, const void* pCompressed, size_t nSrcSize));
MOCK_METHOD1(RecordFileOpen, void(ERecordFileOpenList eList));
MOCK_METHOD2(RecordFile, void(AZ::IO::HandleType in, AZStd::string_view szFilename));
MOCK_METHOD1(GetResourceList, AZ::IO::IResourceList * (ERecordFileOpenList eList));
MOCK_METHOD2(SetResourceList, void(ERecordFileOpenList eList, AZ::IO::IResourceList * pResourceList));
MOCK_METHOD0(GetRecordFileOpenList, AZ::IO::IArchive::ERecordFileOpenList());
MOCK_METHOD2(ComputeCRC, uint32_t(AZStd::string_view szPath, uint32_t nFileOpenFlags));
MOCK_METHOD4(ComputeMD5, bool(AZStd::string_view szPath, uint8_t* md5, uint32_t nFileOpenFlags, bool useDirectAccess));
MOCK_METHOD1(RegisterFileAccessSink, void(AZ::IO::IArchiveFileAccessSink * pSink));
MOCK_METHOD1(UnregisterFileAccessSink, void(AZ::IO::IArchiveFileAccessSink * pSink));
MOCK_METHOD1(DisableRuntimeFileAccess, void(bool status));
MOCK_METHOD2(DisableRuntimeFileAccess, bool(bool status, AZStd::thread_id threadId));
MOCK_METHOD2(CheckFileAccessDisabled, bool(AZStd::string_view name, const char* mode));
MOCK_METHOD1(SetRenderThreadId, void(AZStd::thread_id renderThreadId));
MOCK_CONST_METHOD0(GetPakPriority, AZ::IO::ArchiveLocationPriority());
MOCK_CONST_METHOD1(GetFileOffsetOnMedia, uint64_t(AZStd::string_view szName));
MOCK_CONST_METHOD1(GetFileMediaType, EStreamSourceMediaType(AZStd::string_view szName));
MOCK_METHOD0(GetLevelPackOpenEvent, auto()->LevelPackOpenEvent*);
MOCK_METHOD0(GetLevelPackCloseEvent, auto()->LevelPackCloseEvent*);
// Implementations required for variadic functions
virtual int FPrintf([[maybe_unused]] AZ::IO::HandleType handle, [[maybe_unused]] const char* format, ...) PRINTF_PARAMS(3, 4)
{
return 0;
}
};
+63
View File
@@ -0,0 +1,63 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <ILog.h>
class LogMock
: public ILog
{
public:
MOCK_METHOD3(LogV,
void(const ELogType nType, const char* szFormat, va_list args));
MOCK_METHOD4(LogV,
void(const ELogType nType, int flags, const char* szFormat, va_list args));
MOCK_METHOD0(Release,
void());
MOCK_METHOD2(SetFileName,
bool(const char* fileNameOrFullPath, bool doBackups));
MOCK_METHOD0(GetFileName,
const char*());
MOCK_METHOD0(GetBackupFileName,
const char*());
virtual void Log([[maybe_unused]] const char* szCommand, ...) override {}
virtual void LogWarning([[maybe_unused]] const char* szCommand, ...) override {}
virtual void LogError([[maybe_unused]] const char* szCommand, ...) override {}
virtual void LogAlways([[maybe_unused]] const char* szCommand, ...) override {}
virtual void LogPlus([[maybe_unused]] const char* command, ...) override {}
virtual void LogToFile([[maybe_unused]] const char* command, ...) override {}
virtual void LogToFilePlus([[maybe_unused]] const char* command, ...) override {}
virtual void LogToConsole([[maybe_unused]] const char* command, ...) override {}
virtual void LogToConsolePlus([[maybe_unused]] const char* command, ...) override {}
virtual void UpdateLoadingScreen([[maybe_unused]] const char* command, ...) override {}
MOCK_METHOD1(SetVerbosity,
void(int verbosity));
MOCK_METHOD0(GetVerbosityLevel,
int());
MOCK_METHOD1(AddCallback,
void(ILogCallback * pCallback));
MOCK_METHOD1(RemoveCallback,
void(ILogCallback * pCallback));
MOCK_METHOD0(Update,
void());
MOCK_METHOD0(GetModuleFilter,
const char*());
MOCK_CONST_METHOD1(GetMemoryUsage,
void(ICrySizer * pSizer));
MOCK_METHOD1(Indent,
void(class CLogIndenter * indenter));
MOCK_METHOD1(Unindent,
void(class CLogIndenter * indenter));
MOCK_METHOD0(FlushAndClose,
void());
};
@@ -0,0 +1,45 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <CryMemoryManager.h>
class MemoryManagerMock
: public IMemoryManager
{
public:
MOCK_METHOD1(GetProcessMemInfo,
bool(SProcessMemInfo& minfo));
MOCK_METHOD3(TraceDefineHeap,
HeapHandle(const char* heapName, size_t size, const void* pBase));
MOCK_METHOD6(TraceHeapAlloc,
void(HeapHandle heap, void* mem, size_t size, size_t blockSize, const char* sUsage, const char* sNameHint));
MOCK_METHOD3(TraceHeapFree,
void(HeapHandle heap, void* mem, size_t blockSize));
MOCK_METHOD1(TraceHeapSetColor,
void(uint32 color));
MOCK_METHOD0(TraceHeapGetColor,
uint32());
MOCK_METHOD1(TraceHeapSetLabel,
void(const char* sLabel));
MOCK_METHOD1(CreateCustomMemoryHeapInstance,
ICustomMemoryHeap* const (EAllocPolicy const eAllocPolicy));
MOCK_METHOD3(CreateGeneralExpandingMemoryHeap,
IGeneralMemoryHeap* (size_t upperLimit, size_t reserveSize, const char* sUsage));
MOCK_METHOD3(CreateGeneralMemoryHeap,
IGeneralMemoryHeap* (void* base, size_t sz, const char* sUsage));
MOCK_METHOD2(ReserveAddressRange,
IMemoryAddressRange* (size_t capacity, const char* sName));
MOCK_METHOD2(CreatePageMappingHeap,
IPageMappingHeap* (size_t addressSpace, const char* sName));
MOCK_METHOD0(CreateDefragAllocator,
IDefragAllocator*());
};
@@ -0,0 +1,47 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <INetwork.h>
struct NetworkMock : public INetwork
{
NetworkMock() : m_gridMate(nullptr)
{
}
GridMate::IGridMate* m_gridMate;
void Release() override {}
void GetMemoryStatistics([[maybe_unused]] ICrySizer* pSizer) override {}
void GetBandwidthStatistics([[maybe_unused]] SBandwidthStats* const pStats) override {}
void GetPerformanceStatistics([[maybe_unused]] SNetworkPerformance* pSizer) override {}
void GetProfilingStatistics([[maybe_unused]] SNetworkProfilingStats* const pStats) override {}
void SyncWithGame([[maybe_unused]] ENetworkGameSync syncType) override {}
const char* GetHostName() override { return "testhostname"; }
GridMate::IGridMate* GetGridMate() override
{
return m_gridMate;
}
ChannelId GetChannelIdForSessionMember([[maybe_unused]] GridMate::GridMember* member) const override { return ChannelId(); }
ChannelId GetServerChannelId() const override { return ChannelId(); }
ChannelId GetLocalChannelId() const override { return ChannelId(); }
CTimeValue GetSessionTime() override { return CTimeValue(); }
void ChangedAspects([[maybe_unused]] EntityId id, [[maybe_unused]] NetworkAspectType aspectBits) override {}
void SetDelegatableAspectMask([[maybe_unused]] NetworkAspectType aspectBits) override {}
void SetObjectDelegatedAspectMask([[maybe_unused]] EntityId entityId, [[maybe_unused]] NetworkAspectType aspects, [[maybe_unused]] bool set) override {}
void DelegateAuthorityToClient([[maybe_unused]] EntityId entityId, [[maybe_unused]] ChannelId clientChannelId) override {}
void InvokeActorRMI([[maybe_unused]] EntityId entityId, [[maybe_unused]] uint8 actorExtensionId, [[maybe_unused]] ChannelId targetChannelFilter, [[maybe_unused]] IActorRMIRep& rep) override {}
void InvokeScriptRMI([[maybe_unused]] ISerializable* serializable, [[maybe_unused]] bool isServerRMI, [[maybe_unused]] ChannelId toChannelId = kInvalidChannelId, [[maybe_unused]] ChannelId avoidChannelId = kInvalidChannelId) override {}
void RegisterActorRMI([[maybe_unused]] IActorRMIRep* rep) override {}
void UnregisterActorRMI([[maybe_unused]] IActorRMIRep* rep) override {}
EntityId LocalEntityIdToServerEntityId([[maybe_unused]] EntityId localId) const override { return EntityId(); }
EntityId ServerEntityIdToLocalEntityId([[maybe_unused]] EntityId serverId, [[maybe_unused]] bool allowForcedEstablishment = false) const override { return EntityId(); }
};
@@ -0,0 +1,33 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include "IConsole.h"
// Auto-generated by gmock_gen.py
class IRemoteConsoleMock
: public IRemoteConsole
{
public:
MOCK_METHOD0(RegisterConsoleVariables, void());
MOCK_METHOD0(UnregisterConsoleVariables, void());
MOCK_METHOD0(Start, void());
MOCK_METHOD0(Stop, void());
MOCK_CONST_METHOD0(IsStarted, bool());
MOCK_METHOD1(AddLogMessage, void(const char* log));
MOCK_METHOD1(AddLogWarning, void(const char* log));
MOCK_METHOD1(AddLogError, void(const char* log));
MOCK_METHOD0(Update, void());
MOCK_METHOD2(RegisterListener, void(IRemoteConsoleListener* pListener, const char* name));
MOCK_METHOD1(UnregisterListener, void(IRemoteConsoleListener* pListener));
};
@@ -0,0 +1,877 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <IRenderer.h>
#include <I3DEngine.h> // needed for SRenderingPassInfo definition
#include <IVideoRenderer.h>
#include <IImage.h>
#include <gmock/gmock.h>
// the following was generated using google's python script to autogenerate mocks.
// however, it needed some hand-editing to make it work, so if you add functions to IRenderer,
// it will probably be better to just manually add them here than try to run the script again
// hand-edits are marked with 'hand-edit'. Everything else was autogenerated.
class IRendererMock
: public IRenderer
{
public:
MOCK_METHOD1(AddRenderDebugListener,
void(IRenderDebugListener * pRenderDebugListener));
MOCK_METHOD1(RemoveRenderDebugListener,
void(IRenderDebugListener * pRenderDebugListener));
MOCK_CONST_METHOD0(GetRenderType,
ERenderType());
// Hand-edit: Googlemock cannot handle 14 param functions.
WIN_HWND Init(int, int, int, int, unsigned int, int, int, bool, bool, WIN_HINSTANCE, WIN_HWND = 0,
bool = false, const SCustomRenderInitArgs* = 0, bool = false) override { return nullptr; }
MOCK_METHOD0(PostInit,
void());
MOCK_CONST_METHOD0(IsPost3DRendererEnabled,
bool());
MOCK_METHOD0(GetFeatures,
int());
// Hand-edit: Googlemock doesn't like 'const void' as a return type:
const void SetApiVersion(const AZStd::string&) override {}
const void SetAdapterDescription(const AZStd::string&) override {}
MOCK_CONST_METHOD0(GetApiVersion,
const AZStd::string& ());
MOCK_CONST_METHOD0(GetAdapterDescription,
const AZStd::string& ());
MOCK_METHOD3(GetVideoMemoryUsageStats,
void(size_t&, size_t&, bool));
MOCK_CONST_METHOD0(GetNumGeomInstances,
int());
MOCK_CONST_METHOD0(GetNumGeomInstanceDrawCalls,
int());
MOCK_CONST_METHOD0(GetCurrentNumberOfDrawCalls,
int());
MOCK_CONST_METHOD2(GetCurrentNumberOfDrawCalls,
void(int& nGeneral, int& nShadowGen));
MOCK_CONST_METHOD1(GetCurrentNumberOfDrawCalls,
int(const uint32 EFSListMask));
MOCK_CONST_METHOD1(GetCurrentDrawCallRTTimes,
float(const uint32 EFSListMask));
MOCK_METHOD1(SetDebugRenderNode,
void(IRenderNode * pRenderNode));
MOCK_CONST_METHOD1(IsDebugRenderNode,
bool(IRenderNode * pRenderNode));
MOCK_METHOD1(DeleteContext,
bool(WIN_HWND hWnd));
MOCK_METHOD4(CreateContext,
bool(WIN_HWND, bool, int, int));
MOCK_METHOD1(SetCurrentContext,
bool(WIN_HWND hWnd));
MOCK_METHOD0(MakeMainContextActive,
void());
MOCK_METHOD0(GetCurrentContextHWND,
WIN_HWND());
MOCK_METHOD0(IsCurrentContextMainVP,
bool());
MOCK_CONST_METHOD0(GetCurrentContextViewportHeight,
int());
MOCK_CONST_METHOD0(GetCurrentContextViewportWidth,
int());
MOCK_METHOD1(ShutDown,
void(bool));
MOCK_METHOD0(ShutDownFast,
void());
MOCK_METHOD1(EnumDisplayFormats,
int(SDispFormat * Formats));
MOCK_METHOD1(EnumAAFormats,
int(SAAFormat * Formats));
MOCK_METHOD6(ChangeResolution,
bool(int nNewWidth, int nNewHeight, int nNewColDepth, int nNewRefreshHZ, bool bFullScreen, bool bForceReset));
MOCK_METHOD0(BeginFrame,
void());
MOCK_METHOD1(InitSystemResources,
void(int nFlags));
MOCK_METHOD0(InitTexturesSemantics,
void());
MOCK_METHOD1(FreeResources,
void(int nFlags));
MOCK_METHOD0(Release,
void());
MOCK_METHOD1(RenderDebug,
void(bool));
MOCK_METHOD0(EndFrame,
void());
MOCK_METHOD0(ForceSwapBuffers,
void());
MOCK_METHOD0(TryFlush,
void());
MOCK_CONST_METHOD4(GetViewport,
void(int* x, int* y, int* width, int* height));
MOCK_METHOD5(SetViewport,
void(int, int, int, int, int));
MOCK_METHOD4(SetRenderTile,
void(f32, f32, f32, f32));
MOCK_METHOD4(SetScissor,
void(int, int, int, int));
MOCK_METHOD0(GetViewProjectionMatrix,
Matrix44A & ());
MOCK_METHOD1(SetTranspOrigCameraProjMatrix,
void(Matrix44A & matrix));
MOCK_METHOD2(GetScreenAspect,
EScreenAspectRatio(int nWidth, int nHeight));
MOCK_METHOD2(SetViewportDownscale,
Vec2(float xscale, float yscale));
MOCK_METHOD1(SetViewParameters,
void(const CameraViewParameters& viewParameters));
MOCK_METHOD1(ApplyViewParameters,
void(const CameraViewParameters& viewParameters));
MOCK_METHOD5(DrawDynVB,
void(SVF_P3F_C4B_T2F * pBuf, uint16 * pInds, int nVerts, int nInds, const PublicRenderPrimitiveType nPrimType));
// Hand-edit: google mock has issues with DynUiPrimitiveList
void DrawDynUiPrimitiveList([[maybe_unused]] DynUiPrimitiveList& primitives, [[maybe_unused]] int totalNumVertices, [[maybe_unused]] int totalNumIndices) override { return; }
MOCK_METHOD1(SetCamera,
void(const CCamera& cam));
MOCK_METHOD0(GetCamera,
const CCamera& ());
MOCK_METHOD1(GetRenderViewForThread,
CRenderView * (int nThreadID));
MOCK_METHOD1(SetGammaDelta,
bool(const float fGamma));
MOCK_METHOD0(RestoreGamma,
void(void));
MOCK_METHOD3(ChangeDisplay,
bool(unsigned int width, unsigned int height, unsigned int cbpp));
MOCK_METHOD7(ChangeViewport,
void(unsigned int, unsigned int, unsigned int, unsigned int, bool, float, float));
MOCK_CONST_METHOD6(SaveTga,
bool(unsigned char* sourcedata, int sourceformat, int w, int h, const char* filename, bool flip));
MOCK_METHOD1(SetTexture,
void(int tnum));
MOCK_METHOD2(SetTexture,
void(int tnum, int nUnit));
MOCK_METHOD0(SetWhiteTexture,
void());
MOCK_CONST_METHOD0(GetWhiteTextureId,
int());
MOCK_CONST_METHOD0(GetBlackTextureId,
int());
// Hand-edit: google mock can only do up to 10 parameters
void Draw2dImage(float, float, float, float, int, float, float, float, float, float, float, float, float, float, float) override {};
MOCK_METHOD1(Draw2dImageStretchMode,
void(bool stretch));
// Hand-edit: google mock can only do up to 10 parameters
void Push2dImage(float, float, float, float, int, float, float, float, float, float, float, float, float, float, float, float) override {};
MOCK_METHOD0(Draw2dImageList,
void());
// Hand-edit: Hand-edit: google mock can only do up to 10 parameters
void DrawImage(float, float, float, float, int, float, float, float, float, float, float, float, float, bool) override {}
// Hand-edit: google mock can only do up to 10 parameters
void DrawImageWithUV(float, float, float, float, float, int, float*, float*, float, float, float, float, bool) override {}
MOCK_METHOD1(PushWireframeMode,
void(int mode));
MOCK_METHOD0(PopWireframeMode,
void());
MOCK_CONST_METHOD0(GetHeight,
int());
MOCK_CONST_METHOD0(GetWidth,
int());
MOCK_CONST_METHOD0(GetPixelAspectRatio,
float());
MOCK_CONST_METHOD0(GetOverlayHeight,
int());
MOCK_CONST_METHOD0(GetOverlayWidth,
int());
MOCK_CONST_METHOD0(GetMaxSquareRasterDimension,
int());
MOCK_METHOD0(SwitchToNativeResolutionBackbuffer,
void());
MOCK_METHOD1(GetMemoryUsage,
void(ICrySizer * Sizer));
MOCK_METHOD1(GetBandwidthStats,
void(float* fBandwidthRequested));
MOCK_METHOD1(SetTextureStreamListener,
void(ITextureStreamListener * pListener));
MOCK_METHOD2(GetOcclusionBuffer,
int(uint16 * pOutOcclBuffer, Matrix44 * pmCamBuffer));
MOCK_METHOD2(ScreenShot,
bool(const char*, int));
MOCK_METHOD0(GetColorBpp,
int());
MOCK_METHOD0(GetDepthBpp,
int());
MOCK_METHOD0(GetStencilBpp,
int());
MOCK_CONST_METHOD0(IsStereoEnabled,
bool());
MOCK_CONST_METHOD0(GetNearestRangeMax,
float());
MOCK_METHOD0(GetPerInstanceConstantBufferPoolPointer,
PerInstanceConstantBufferPool * ());
MOCK_METHOD6(ProjectToScreen,
bool(float ptx, float pty, float ptz, float* sx, float* sy, float* sz));
MOCK_METHOD9(UnProject,
int(float sx, float sy, float sz, float* px, float* py, float* pz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4]));
MOCK_METHOD6(UnProjectFromScreen,
int(float sx, float sy, float sz, float* px, float* py, float* pz));
MOCK_METHOD1(GetModelViewMatrix,
void(float* mat));
MOCK_METHOD1(GetProjectionMatrix,
void(float* mat));
MOCK_METHOD7(WriteDDS,
bool(const byte * dat, int wdt, int hgt, int Size, const char* name, ETEX_Format eF, int NumMips));
MOCK_METHOD6(WriteTGA,
bool(const byte * dat, int wdt, int hgt, const char* name, int src_bits_per_pixel, int dest_bits_per_pixel));
MOCK_METHOD6(WriteJPG,
bool(const byte*, int, int, char*, int, int));
MOCK_METHOD6(FontCreateTexture,
int(int, int, byte*, ETEX_Format, bool, const char*));
MOCK_METHOD6(FontUpdateTexture,
bool(int nTexId, int X, int Y, int USize, int VSize, byte * pData));
MOCK_METHOD2(FontSetTexture,
void(int nTexId, int nFilterMode));
MOCK_METHOD2(FontSetRenderingState,
void(bool overrideViewProjMatrices, TransformationMatrices & backupMatrices));
MOCK_METHOD3(FontSetBlending,
void(int src, int dst, int baseState));
MOCK_METHOD2(FontRestoreRenderingState,
void(bool overrideViewProjMatrices, const TransformationMatrices& restoringMatrices));
MOCK_METHOD3(FlushRTCommands,
bool(bool bWait, bool bImmediatelly, bool bForce));
MOCK_CONST_METHOD7(DrawStringU,
void(IFFont_RenderProxy * pFont, float x, float y, float z, const char* pStr, const bool asciiMultiLine, const STextDrawContext& ctx));
MOCK_METHOD0(RT_CurThreadList,
int());
MOCK_METHOD6(EF_PrecacheResource,
bool(SShaderItem*, float, float, int, int, int));
MOCK_METHOD4(EF_PrecacheResource,
bool(IShader * pSH, float fMipFactor, float fTimeToReady, int Flags));
MOCK_METHOD6(EF_PrecacheResource,
bool(ITexture*, float, float, int, int, int));
MOCK_METHOD6(EF_PrecacheResource,
bool(IRenderMesh * pPB, _smart_ptr<IMaterial> pMaterial, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId));
MOCK_METHOD5(EF_PrecacheResource,
bool(CDLight * pLS, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId));
// Hand-edit: google mock can only do up to 10 parameters
ITexture* EF_CreateCompositeTexture([[maybe_unused]] int type, [[maybe_unused]] const char* szName, [[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] int nDepth, [[maybe_unused]] int nMips, [[maybe_unused]] int nFlags, [[maybe_unused]] ETEX_Format eTF, [[maybe_unused]] const STexComposition* pCompositions, [[maybe_unused]] size_t nCompositions, [[maybe_unused]] int8 nPriority = -1) override { return nullptr; }
MOCK_METHOD0(PostLevelLoading,
void());
MOCK_METHOD0(PostLevelUnload,
void());
MOCK_METHOD10(EF_AddPolygonToScene,
CRenderObject * (SShaderItem & si, int numPts, const SVF_P3F_C4B_T2F * verts, const SPipTangents * tangs, CRenderObject * obj, const SRenderingPassInfo& passInfo, uint16 * inds, int ninds, int nAW, const SRendItemSorter& rendItemSorter));
MOCK_METHOD10(EF_AddPolygonToScene,
CRenderObject * (SShaderItem & si, CRenderObject * obj, const SRenderingPassInfo& passInfo, int numPts, int ninds, SVF_P3F_C4B_T2F * &verts, SPipTangents * &tangs, uint16 * &inds, int nAW, const SRendItemSorter& rendItemSorter));
MOCK_METHOD0(ForceUpdateGlobalShaderParameters,
void());
MOCK_METHOD1(EF_SetShaderMissCallback,
void(ShaderCacheMissCallback callback));
MOCK_METHOD0(EF_GetShaderMissLogPath,
const char*());
MOCK_METHOD1(EF_GetShaderNames,
string * (int& nNumShaders));
MOCK_METHOD1(EF_ReloadFile,
bool(const char* szFileName));
MOCK_METHOD1(EF_ReloadFile_Request,
bool(const char* szFileName));
MOCK_METHOD2(EF_LoadImage,
_smart_ptr<IImageFile>(const char* szFileName, uint32 nFlags));
MOCK_METHOD3(EF_GetRemapedShaderMaskGen,
uint64(const char*, uint64, bool));
MOCK_METHOD3(EF_GetShaderGlobalMaskGenFromString,
uint64(const char*, const char*, uint64));
MOCK_METHOD2(EF_GetStringFromShaderGlobalMaskGen,
AZStd::string(const char*, uint64));
MOCK_CONST_METHOD1(GetShaderProfile,
const SShaderProfile& (EShaderType eST));
MOCK_METHOD2(EF_SetShaderQuality,
void(EShaderType eST, EShaderQuality eSQ));
MOCK_CONST_METHOD0(EF_GetRenderQuality,
ERenderQuality());
MOCK_METHOD1(EF_GetShaderQuality,
EShaderQuality(EShaderType eST));
MOCK_METHOD5(EF_LoadShaderItem,
SShaderItem(const char*, bool, int, SInputShaderResources*, uint64));
MOCK_METHOD3(EF_LoadShader,
IShader * (const char*, int, uint64));
MOCK_METHOD1(EF_ReloadShaderFiles,
void(int nCategory));
MOCK_METHOD0(EF_ReloadTextures,
void());
MOCK_METHOD1(EF_GetTextureByID,
ITexture * (int Id));
MOCK_METHOD2(EF_GetTextureByName,
ITexture * (const char*, uint32));
MOCK_METHOD2(EF_LoadTexture,
ITexture * (const char*, uint32));
MOCK_METHOD2(EF_LoadCubemapTexture,
ITexture * (const char*, uint32));
MOCK_METHOD1(EF_LoadDefaultTexture,
ITexture * (const char* nameTex));
MOCK_METHOD1(EF_LoadLightmap,
int(const char* name));
MOCK_METHOD3(EF_RenderEnvironmentCubeHDR,
bool(int size, Vec3 & Pos, TArray<unsigned short>&vecData));
MOCK_METHOD1(EF_CreateRE,
IRenderElement * (EDataType edt));
MOCK_METHOD1(EF_StartEf,
void(const SRenderingPassInfo& passInfo));
MOCK_METHOD3(EF_GetObjData,
SRenderObjData * (CRenderObject * pObj, bool bCreate, int nThreadID));
MOCK_METHOD1(EF_GetObject_Temp,
CRenderObject * (int nThreadID));
MOCK_METHOD2(EF_DuplicateRO,
CRenderObject * (CRenderObject * pObj, const SRenderingPassInfo& passInfo));
MOCK_METHOD7(EF_AddEf,
void(IRenderElement * pRE, SShaderItem & pSH, CRenderObject * pObj, const SRenderingPassInfo& passInfo, int nList, int nAW, const SRendItemSorter& rendItemSorter));
MOCK_METHOD4(EF_EndEf3D,
void(const int nFlags, const int nPrecacheUpdateId, const int nNearPrecacheUpdateId, const SRenderingPassInfo& passInfo));
MOCK_METHOD1(EF_InvokeShadowMapRenderJobs,
void(const int nFlags));
MOCK_METHOD1(EF_IsFakeDLight,
bool(const CDLight * Source));
MOCK_METHOD2(EF_ADDDlight,
void(CDLight * Source, const SRenderingPassInfo& passInfo));
MOCK_METHOD1(EF_UpdateDLight,
bool(SRenderLight * pDL));
MOCK_METHOD1(EF_AddDeferredDecal,
bool(const SDeferredDecal& rDecal));
MOCK_METHOD4(EF_AddDeferredLight,
int(const CDLight& pLight, float fMult, const SRenderingPassInfo& passInfo, const SRendItemSorter& rendItemSorter));
MOCK_METHOD1(EF_GetDeferredLightsNum,
uint32(eDeferredLightType));
MOCK_METHOD0(EF_ClearDeferredLightsList,
void());
MOCK_METHOD2(EF_GetDeferredLights,
TArray<SRenderLight>*(const SRenderingPassInfo&, const eDeferredLightType));
MOCK_METHOD1(EF_AddDeferredClipVolume,
uint8(const IClipVolume * pClipVolume));
MOCK_METHOD2(EF_SetDeferredClipVolumeBlendData,
bool(const IClipVolume * pClipVolume, const SClipVolumeBlendInfo& blendInfo));
MOCK_METHOD0(EF_ClearDeferredClipVolumesList,
void());
MOCK_METHOD0(EF_ReleaseDeferredData,
void());
MOCK_METHOD1(EF_ReleaseInputShaderResource,
void(SInputShaderResources * pRes));
MOCK_METHOD3(EF_SetPostEffectParam,
void(const char*, float, bool));
MOCK_METHOD3(EF_SetPostEffectParamVec4,
void(const char*, const Vec4&, bool));
MOCK_METHOD2(EF_SetPostEffectParamString,
void(const char* pParam, const char* pszArg));
MOCK_METHOD2(EF_GetPostEffectParam,
void(const char* pParam, float& fValue));
MOCK_METHOD2(EF_GetPostEffectParamVec4,
void(const char* pParam, Vec4 & pValue));
MOCK_METHOD2(EF_GetPostEffectParamString,
void(const char* pParam, const char* & pszArg));
MOCK_METHOD1(EF_GetPostEffectID,
int32(const char* pPostEffectName));
MOCK_METHOD1(EF_ResetPostEffects,
void(bool));
MOCK_METHOD0(SyncPostEffects,
void());
MOCK_METHOD0(EF_DisableTemporalEffects,
void());
MOCK_METHOD3(EF_AddWaterSimHit,
void(const Vec3& vPos, const float scale, const float strength));
MOCK_METHOD0(EF_DrawWaterSimHits,
void());
MOCK_METHOD1(EF_EndEf2D,
void(const bool bSort));
MOCK_METHOD0(ForceGC,
void());
MOCK_CONST_METHOD0(GetPolyCount,
int());
MOCK_CONST_METHOD2(GetPolyCount,
void(int& nPolygons, int& nShadowVolPolys));
MOCK_METHOD1(SetClearColor,
void(const Vec3& vColor));
MOCK_METHOD1(SetClearBackground,
void(bool bClearBackground));
MOCK_METHOD4(CreateRenderMesh,
_smart_ptr<IRenderMesh>(const char*, const char*, IRenderMesh::SInitParamerers*, ERenderMeshType));
// Hand-edit: google mock can only do up to 10 parameters
virtual _smart_ptr<IRenderMesh> CreateRenderMeshInitialized(
const void*, int, const AZ::Vertex::Format&, const vtx_idx*, int, const PublicRenderPrimitiveType,
const char*, const char*, ERenderMeshType = eRMT_Static, int = 1, int = 0,
[[maybe_unused]] bool (*PrepareBufferCallback)(IRenderMesh*, bool) = nullptr, void* = nullptr, bool = false, bool = true,
const SPipTangents* = nullptr, bool = false, Vec3* = nullptr)
{
return _smart_ptr<IRenderMesh>();
}
MOCK_METHOD1(GetFrameID,
int(bool));
MOCK_CONST_METHOD0(GetCameraFrameID,
int());
MOCK_CONST_METHOD0(IsRenderToTextureActive,
bool());
MOCK_METHOD4(MakeMatrix,
void(const Vec3& pos, const Vec3& angles, const Vec3& scale, Matrix34 * mat));
MOCK_METHOD4(DrawTextQueued,
void(Vec3 pos, SDrawTextInfo & ti, const char* format, va_list args));
MOCK_METHOD3(DrawTextQueued,
void(Vec3 pos, SDrawTextInfo & ti, const char* text));
MOCK_CONST_METHOD1(ScaleCoordX,
float(float value));
MOCK_CONST_METHOD1(ScaleCoordY,
float(float value));
MOCK_CONST_METHOD2(ScaleCoord,
void(float& x, float& y));
MOCK_METHOD2(SetState,
void(int, int));
MOCK_METHOD1(SetCullMode,
void(int));
MOCK_METHOD5(SetStencilState,
void(int, uint32, uint32, uint32, bool));
MOCK_METHOD1(PushProfileMarker,
void(const char* label));
MOCK_METHOD1(PopProfileMarker,
void(const char* label));
MOCK_METHOD1(EnableFog,
bool(bool enable));
MOCK_METHOD1(SetFogColor,
void(const ColorF& color));
MOCK_METHOD4(SetColorOp,
void(byte eCo, byte eAo, byte eCa, byte eAa));
MOCK_METHOD1(SetSrgbWrite,
void(bool srgbWrite));
MOCK_METHOD1(RequestFlushAllPendingTextureStreamingJobs,
void(int nFrames));
MOCK_METHOD1(SetTexturesStreamingGlobalMipFactor,
void(float fFactor));
MOCK_METHOD1(GetIRenderAuxGeom,
IRenderAuxGeom * (void*));
MOCK_METHOD0(GetISvoRenderer,
ISvoRenderer * ());
MOCK_METHOD0(GetIColorGradingController,
IColorGradingController * ());
MOCK_METHOD0(GetIStereoRenderer,
IStereoRenderer * ());
MOCK_METHOD7(Create2DTexture,
ITexture * (const char* name, int width, int height, int numMips, int flags, unsigned char* data, ETEX_Format format));
void TextToScreen([[maybe_unused]] float x, [[maybe_unused]] float y, [[maybe_unused]] const char* format, ...) override {}
void TextToScreenColor([[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] float r, [[maybe_unused]] float g, [[maybe_unused]] float b, [[maybe_unused]] float a, [[maybe_unused]] const char* format, ...) override {}
MOCK_METHOD0(ResetToDefault,
void());
MOCK_METHOD4(SetMaterialColor,
void(float r, float g, float b, float a));
MOCK_METHOD0(SetDefaultRenderStates,
void());
MOCK_METHOD10(Graph,
void(byte * g, int x, int y, int wdt, int hgt, int nC, int type, const char* text, ColorF & color, float fScale));
MOCK_METHOD0(EF_RenderTextMessages,
void());
MOCK_METHOD1(ClearTargetsImmediately,
void(uint32 nFlags));
MOCK_METHOD3(ClearTargetsImmediately,
void(uint32 nFlags, const ColorF& Colors, float fDepth));
MOCK_METHOD2(ClearTargetsImmediately,
void(uint32 nFlags, const ColorF& Colors));
MOCK_METHOD2(ClearTargetsImmediately,
void(uint32 nFlags, float fDepth));
MOCK_METHOD1(ClearTargetsLater,
void(uint32 nFlags));
MOCK_METHOD3(ClearTargetsLater,
void(uint32 nFlags, const ColorF& Colors, float fDepth));
MOCK_METHOD2(ClearTargetsLater,
void(uint32 nFlags, const ColorF& Colors));
MOCK_METHOD2(ClearTargetsLater,
void(uint32 nFlags, float fDepth));
MOCK_METHOD8(ReadFrameBuffer,
void(unsigned char*, int, int, int, ERB_Type, bool, int, int));
MOCK_METHOD4(ReadFrameBufferFast,
void(uint32*, int, int, bool));
MOCK_METHOD1(EnableVSync,
void(bool enable));
MOCK_METHOD1(CreateResourceAsync,
void(SResourceAsync * Resource));
MOCK_METHOD1(ReleaseResourceAsync,
void(SResourceAsync * Resource));
MOCK_METHOD1(ReleaseResourceAsync,
void(AZStd::unique_ptr<SResourceAsync> Resource));
// Hand-edit: google mock can only do up to 10 parameters
unsigned int DownLoadToVideoMemory(const byte*, int, int, ETEX_Format, ETEX_Format, int, bool = true,
int = FILTER_BILINEAR, int = 0, const char* = nullptr, int = 0, EEndian = eLittleEndian,
RectI* = nullptr, bool = false) override { return 0; }
unsigned int DownLoadToVideoMemory3D(const byte*, int, int, [[maybe_unused]] int d, ETEX_Format, ETEX_Format, int, bool = true,
int = FILTER_BILINEAR, int = 0, const char* = nullptr, int = 0, EEndian = eLittleEndian,
RectI* = nullptr, bool = false) override { return 0; }
unsigned int DownLoadToVideoMemoryCube(const byte*, int, int, ETEX_Format, ETEX_Format, int, bool = true,
int = FILTER_BILINEAR, int = 0, const char* = nullptr, int = 0, EEndian = eLittleEndian,
RectI* = nullptr, bool = false) override { return 0; }
MOCK_METHOD9(UpdateTextureInVideoMemory,
void(uint32, const byte*, int, int, int, int, ETEX_Format, int, int));
MOCK_METHOD8(DXTCompress,
bool(const byte * raw_data, int nWidth, int nHeight, ETEX_Format eTF, bool bUseHW, bool bGenMips, int nSrcBytesPerPix, MIPDXTcallback callback));
MOCK_METHOD9(DXTDecompress,
bool(const byte * srcData, const size_t srcFileSize, byte * dstData, int nWidth, int nHeight, int nMips, ETEX_Format eSrcTF, bool bUseHW, int nDstBytesPerPix));
MOCK_METHOD1(RemoveTexture,
void(unsigned int TextureId));
MOCK_METHOD1(DeleteFont,
void(IFFont * font));
MOCK_METHOD2(BakeMesh,
bool(const SMeshBakingInputParams * pInputParams, SMeshBakingOutput * pReturnValues));
MOCK_METHOD3(CaptureFrameBufferFast,
bool(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight));
MOCK_METHOD3(CopyFrameBufferFast,
bool(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight));
MOCK_METHOD1(RegisterCaptureFrame,
bool(ICaptureFrameListener * pCapture));
MOCK_METHOD1(UnRegisterCaptureFrame,
bool(ICaptureFrameListener * pCapture));
MOCK_METHOD2(InitCaptureFrameBufferFast,
bool(uint32, uint32));
MOCK_METHOD0(CloseCaptureFrameBufferFast,
void(void));
MOCK_METHOD0(CaptureFrameBufferCallBack,
void(void));
MOCK_METHOD1(RegisterSyncWithMainListener,
void(ISyncMainWithRenderListener * pListener));
MOCK_METHOD1(RemoveSyncWithMainListener,
void(const ISyncMainWithRenderListener * pListener));
MOCK_METHOD5(Set2DMode,
void(uint32, uint32, TransformationMatrices&, float, float));
MOCK_METHOD1(Unset2DMode,
void(const TransformationMatrices& restoringMatrices));
MOCK_METHOD7(Set2DModeNonZeroTopLeft,
void(float, float, float, float, TransformationMatrices&, float, float));
MOCK_METHOD1(ScreenToTexture,
int(int nTexID));
MOCK_METHOD1(EnableSwapBuffers,
void(bool bEnable));
MOCK_METHOD0(GetHWND,
WIN_HWND());
MOCK_METHOD1(SetWindowIcon,
bool(const char* path));
MOCK_METHOD1(OnEntityDeleted,
void(struct IRenderNode* pRenderNode));
MOCK_METHOD5(CreateRenderTarget,
int(const char* name, int nWidth, int nHeight, const ColorF& clearColor, ETEX_Format eTF));
MOCK_METHOD1(DestroyRenderTarget,
bool(int nHandle));
MOCK_METHOD3(ResizeRenderTarget,
bool(int nHandle, int nWidth, int nHeight));
MOCK_METHOD2(SetRenderTarget,
bool(int, SDepthTexture*));
MOCK_METHOD3(CreateDepthSurface,
SDepthTexture * (int, int, bool));
MOCK_METHOD1(DestroyDepthSurface,
void(SDepthTexture * pDepthSurf));
MOCK_CONST_METHOD1(CreateOptics,
IOpticsElementBase * (EFlareType type));
MOCK_METHOD1(PauseTimer,
void(bool bPause));
MOCK_METHOD0(CreateShaderPublicParams,
IShaderPublicParams * ());
MOCK_CONST_METHOD2(GetThreadIDs,
void(threadID & mainThreadID, threadID & renderThreadID));
MOCK_METHOD1(EnableGPUTimers2,
void(bool bEnabled));
MOCK_METHOD1(AllowGPUTimers2,
void(bool bAllow));
MOCK_CONST_METHOD2(GetRPPStats,
const RPProfilerStats * (ERenderPipelineProfilerStats, bool));
MOCK_CONST_METHOD1(GetRPPStatsArray,
const RPProfilerStats * (bool));
MOCK_METHOD4(GetPolygonCountByType,
int(uint32, EVertexCostTypes, uint32, bool));
MOCK_METHOD5(SetCloudShadowsParams,
void(int nTexID, const Vec3& speed, float tiling, bool invert, float brightness));
MOCK_METHOD2(PushFogVolumeContribution,
uint16(const SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo));
MOCK_METHOD2(PushFogVolume,
void(class CREFogVolume * pFogVolume, const SRenderingPassInfo& passInfo));
MOCK_METHOD0(GetMaxTextureSize,
int());
MOCK_METHOD1(GetTextureFormatName,
const char*(ETEX_Format eTF));
MOCK_METHOD5(GetTextureFormatDataSize,
int(int nWidth, int nHeight, int nDepth, int nMips, ETEX_Format eTF));
MOCK_METHOD2(SetDefaultMaterials,
void(_smart_ptr<IMaterial> pDefMat, _smart_ptr<IMaterial> pTerrainDefMat));
MOCK_CONST_METHOD0(GetGPUParticleEngine,
IGPUParticleEngine * ());
MOCK_CONST_METHOD0(GetActiveGPUCount,
uint32());
MOCK_METHOD0(GetShadowFrustumMGPUCache,
ShadowFrustumMGPUCache * ());
MOCK_CONST_METHOD0(GetCachedShadowsResolution,
const StaticArray<int, MAX_GSM_LODS_NUM>&());
MOCK_METHOD1(SetCachedShadowsResolution,
void(const StaticArray<int, MAX_GSM_LODS_NUM>&arrResolutions));
MOCK_CONST_METHOD1(UpdateCachedShadowsLodCount,
void(int nGsmLods));
MOCK_METHOD1(SetTexturePrecaching,
void(bool stat));
MOCK_METHOD2(RT_InsertGpuCallback,
void(uint32 context, GpuCallbackFunc callback));
MOCK_METHOD1(EnablePipelineProfiler,
void(bool bEnable));
MOCK_METHOD1(GetRenderTimes,
void(SRenderTimes & outTimes));
MOCK_METHOD0(GetGPUFrameTime,
float());
MOCK_METHOD1(EnableBatchMode,
void(bool enable));
MOCK_METHOD1(EnableLevelUnloading,
void(bool enable));
MOCK_METHOD0(OnLevelLoadFailed,
void());
#if !defined(_RELEASE)
MOCK_METHOD1(GetDrawCallsInfoPerMesh,
RNDrawcallsMapMesh & (bool));
MOCK_METHOD1(GetDrawCallsInfoPerMeshPreviousFrame,
RNDrawcallsMapMesh & (bool));
MOCK_METHOD1(GetDrawCallsInfoPerNodePreviousFrame,
RNDrawcallsMapNode & (bool));
MOCK_METHOD1(GetDrawCallsPerNode,
int(IRenderNode * pRenderNode));
MOCK_METHOD1(ForceRemoveNodeFromDrawCallsMap,
void(IRenderNode * pNode));
#endif
MOCK_METHOD1(CollectDrawCallsInfo,
void(bool status));
MOCK_METHOD1(CollectDrawCallsInfoPerNode,
void(bool status));
MOCK_METHOD0(HasLoadedDefaultResources,
bool());
MOCK_METHOD3(EF_CreateSkinningData,
SSkinningData * (uint32, bool, bool));
MOCK_METHOD4(EF_CreateRemappedSkinningData,
SSkinningData * (uint32 nNumBones, SSkinningData * pSourceSkinningData, uint32 nCustomDataSize, uint32 pairGuid));
MOCK_METHOD0(EF_ClearSkinningDataPool,
void());
MOCK_METHOD0(EF_GetSkinningPoolID,
int());
MOCK_METHOD1(ClearShaderItem,
void(SShaderItem * pShaderItem));
MOCK_METHOD2(UpdateShaderItem,
void(SShaderItem * pShaderItem, _smart_ptr<IMaterial> pMaterial));
MOCK_METHOD2(ForceUpdateShaderItem,
void(SShaderItem * pShaderItem, _smart_ptr<IMaterial> pMaterial));
MOCK_METHOD2(RefreshShaderResourceConstants,
void(SShaderItem * pShaderItem, IMaterial * pMaterial));
MOCK_METHOD0(IsStereoModeChangePending,
bool());
MOCK_METHOD1(LockParticleVideoMemory,
void(uint32 nId));
MOCK_METHOD1(UnLockParticleVideoMemory,
void(uint32 nId));
MOCK_METHOD1(BeginSpawningGeneratingRendItemJobs,
void(int nThreadID));
MOCK_METHOD1(BeginSpawningShadowGeneratingRendItemJobs,
void(int nThreadID));
MOCK_METHOD0(EndSpawningGeneratingRendItemJobs,
void());
MOCK_METHOD1(StartLoadtimePlayback,
void(ILoadtimeCallback* pCallback));
MOCK_METHOD0(StopLoadtimePlayback,
void());
MOCK_METHOD0(GetGenerateRendItemJobExecutor,
AZ::LegacyJobExecutor*());
MOCK_METHOD0(GetGenerateShadowRendItemJobExecutor,
AZ::LegacyJobExecutor*());
MOCK_METHOD0(GetGenerateRendItemJobExecutorPreProcess,
AZ::LegacyJobExecutor*());
MOCK_METHOD1(GetFinalizeRendItemJobExecutor,
AZ::LegacyJobExecutor*(int nThreadID));
MOCK_METHOD1(GetFinalizeShadowRendItemJobExecutor,
AZ::LegacyJobExecutor*(int nThreadID));
MOCK_METHOD0(FlushPendingTextureTasks,
void());
MOCK_METHOD1(SetShadowJittering,
void(float fShadowJittering));
MOCK_CONST_METHOD0(GetShadowJittering,
float());
MOCK_METHOD0(LoadShaderStartupCache,
bool());
MOCK_METHOD0(UnloadShaderStartupCache,
void());
MOCK_METHOD0(LoadShaderLevelCache,
bool());
MOCK_METHOD0(UnloadShaderLevelCache,
void());
MOCK_METHOD1(StartScreenShot,
void(int e_ScreenShot));
MOCK_METHOD1(EndScreenShot,
void(int e_ScreenShot));
MOCK_METHOD3(SetRendererCVar,
void(ICVar*, const char*, const bool));
MOCK_METHOD0(GetRenderPipeline,
SRenderPipeline * ());
MOCK_METHOD0(GetShaderManager,
CShaderMan * ());
MOCK_METHOD0(GetRenderThread,
SRenderThread * ());
MOCK_METHOD0(GetWhiteTexture,
ITexture * ());
MOCK_METHOD3(GetTextureForName,
ITexture * (const char* name, uint32 nFlags, ETEX_Format eFormat));
MOCK_METHOD0(GetViewParameters,
const CameraViewParameters& ());
MOCK_METHOD0(GetFrameReset,
uint32());
MOCK_METHOD0(GetDepthBufferOrig,
SDepthTexture * ());
MOCK_METHOD0(GetBackBufferWidth,
uint32());
MOCK_METHOD0(GetBackBufferHeight,
uint32());
MOCK_METHOD0(GetDeviceBufferManager,
CDeviceBufferManager * ());
MOCK_CONST_METHOD0(GetRenderTileInfo,
const SRenderTileInfo * ());
MOCK_METHOD0(GetIdentityMatrix,
Matrix44A());
MOCK_CONST_METHOD0(RT_GetCurrGpuID,
int32());
MOCK_METHOD0(GenerateTextureId,
int());
MOCK_METHOD2(SetCull,
void(ECull, bool));
MOCK_METHOD10(DrawQuad,
void(float x0, float y0, float x1, float y1, const ColorF& color, float z, float s0, float t0, float s1, float t1));
MOCK_METHOD9(DrawQuad3D,
void(const Vec3& v0, const Vec3& v1, const Vec3& v2, const Vec3& v3, const ColorF& color, float ftx0, float fty0, float ftx1, float fty1));
MOCK_METHOD0(FX_ResetPipe,
void());
MOCK_METHOD4(FX_GetDepthSurface,
SDepthTexture * (int, int, bool, bool));
MOCK_METHOD5(FX_CheckOverflow,
void(int, int, IRenderElement*, int*, int*));
MOCK_METHOD1(FX_PreRender,
void(int Stage));
MOCK_METHOD0(FX_PostRender,
void());
MOCK_METHOD3(FX_SetState,
void(int, int, int));
MOCK_METHOD3(FX_CommitStates,
void(const SShaderTechnique * pTech, const SShaderPass * pPass, bool bUseMaterialState));
MOCK_METHOD1(FX_Commit,
void(bool));
MOCK_METHOD2(FX_SetVertexDeclaration,
long(int StreamMask, const AZ::Vertex::Format& vertexFormat));
MOCK_METHOD7(FX_DrawIndexedPrimitive,
void(eRenderPrimitiveType, int, int, int, int, int, bool));
MOCK_METHOD3(FX_SetIStream,
long(const void* pB, uint32 nOffs, RenderIndexType idxType));
MOCK_METHOD5(FX_SetVStream,
long(int, const void*, uint32, uint32, uint32));
MOCK_METHOD4(FX_DrawPrimitive,
void(eRenderPrimitiveType, int, int, int));
MOCK_METHOD1(FX_ClearTarget,
void(ITexture * pTex));
MOCK_METHOD1(FX_ClearTarget,
void(SDepthTexture * pTex));
MOCK_METHOD4(FX_SetRenderTarget,
bool(int, void*, SDepthTexture*, uint32));
MOCK_METHOD4(FX_PushRenderTarget,
bool(int, void*, SDepthTexture*, uint32));
MOCK_METHOD7(FX_SetRenderTarget,
bool(int, CTexture*, SDepthTexture*, bool, int, bool, uint32));
MOCK_METHOD6(FX_PushRenderTarget,
bool(int, CTexture*, SDepthTexture*, int, bool, uint32));
MOCK_METHOD1(FX_RestoreRenderTarget,
bool(int nTarget));
MOCK_METHOD1(FX_PopRenderTarget,
bool(int nTarget));
MOCK_METHOD1(FX_SetActiveRenderTargets,
void(bool bAllowDIP));
MOCK_METHOD4(FX_Start,
void(CShader * ef, int nTech, CShaderResources * Res, IRenderElement * re));
MOCK_METHOD1(RT_PopRenderTarget,
void(int nTarget));
MOCK_METHOD5(RT_SetViewport,
void(int, int, int, int, int));
MOCK_METHOD4(RT_PushRenderTarget,
void(int nTarget, CTexture * pTex, SDepthTexture * pDS, int nS));
MOCK_METHOD5(EF_Scissor,
void(bool bEnable, int sX, int sY, int sWdt, int sHgt));
#ifdef SUPPORT_HW_MOUSE_CURSOR
MOCK_METHOD0(GetIHWMouseCursor,
IHWMouseCursor * ());
#endif
MOCK_METHOD0(GetRecursionLevel,
int());
MOCK_METHOD2(GetIntegerConfigurationValue,
int(const char* varName, int defaultValue));
MOCK_METHOD2(GetFloatConfigurationValue,
float(const char* varName, float defaultValue));
MOCK_METHOD2(GetBooleanConfigurationValue,
bool(const char* varName, bool defaultValue));
MOCK_METHOD3(ApplyDepthTextureState,
void(int unit, int nFilter, bool clamp));
MOCK_METHOD0(GetZTargetTexture,
ITexture * ());
MOCK_METHOD1(GetTextureState,
int(const STexState& TS));
MOCK_METHOD7(TextureDataSize,
uint32(uint32, uint32, uint32, uint32, uint32, ETEX_Format, ETEX_TileMode));
MOCK_METHOD6(ApplyForID,
void(int nID, int nTUnit, int nTState, int nTexMaterialSlot, int nSUnit, bool useWhiteDefault));
MOCK_METHOD9(Create3DTexture,
ITexture * (const char* szName, int nWidth, int nHeight, int nDepth, int nMips, int nFlags, const byte * pData, ETEX_Format eTFSrc, ETEX_Format eTFDst));
MOCK_METHOD1(IsTextureExist,
bool(const ITexture * pTex));
MOCK_METHOD1(NameForTextureFormat,
const char*(ETEX_Format eTF));
MOCK_METHOD1(NameForTextureType,
const char*(ETEX_Type eTT));
MOCK_METHOD0(IsVideoThreadModeEnabled,
bool());
MOCK_METHOD5(CreateDynTexture2,
IDynTexture * (uint32 nWidth, uint32 nHeight, uint32 nTexFlags, const char* szSource, ETexPool eTexPool));
MOCK_METHOD0(GetCurrentTextureAtlasSize,
uint32());
MOCK_METHOD2(BeginProfilerSection,
void(const char*, uint32));
MOCK_METHOD1(EndProfilerSection,
void(const char*));
MOCK_METHOD1(AddProfilerLabel,
void(const char*));
MOCK_METHOD1(InitializeVideoRenderer,
void(AZ::VideoRenderer::IVideoRenderer* pVideoRenderer));
MOCK_METHOD1(CleanupVideoRenderer,
void(AZ::VideoRenderer::IVideoRenderer* pVideoRenderer));
MOCK_METHOD2(DrawVideoRenderer,
void(AZ::VideoRenderer::IVideoRenderer* pVideoRenderer, const AZ::VideoRenderer::DrawArguments& drawArguments));
MOCK_METHOD5(EF_QueryImpl,
void(ERenderQueryTypes eQuery, void* pInOut0, uint32 nInOutSize0, void* pInOut1, uint32 nInOutSize1));
};
@@ -0,0 +1,354 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <ISystem.h>
#include <Cry_Camera.h>
#ifdef GetUserName
#undef GetUserName
#endif
class SystemMock
: public ISystem
{
public:
MOCK_METHOD0(Release,
void());
MOCK_CONST_METHOD0(GetCVarsWhiteListConfigSink,
ILoadConfigurationEntrySink * ());
MOCK_METHOD0(GetGlobalEnvironment,
SSystemGlobalEnvironment * ());
MOCK_METHOD2(UpdatePreTickBus,
bool(int, int));
MOCK_METHOD2(UpdatePostTickBus,
bool(int, int));
MOCK_METHOD0(UpdateLoadtime,
bool());
MOCK_METHOD0(DoWorkDuringOcclusionChecks,
void());
MOCK_METHOD0(NeedDoWorkDuringOcclusionChecks,
bool());
MOCK_METHOD0(Render,
void());
MOCK_METHOD0(RenderBegin,
void());
MOCK_METHOD2(RenderEnd,
void(bool, bool));
MOCK_METHOD2(SynchronousLoadingTick,
void(const char* pFunc, int line));
MOCK_METHOD0(RenderStatistics,
void());
MOCK_METHOD0(GetUsedMemory,
uint32());
MOCK_METHOD0(GetUserName,
const char*());
MOCK_METHOD0(GetCPUFlags,
int());
MOCK_METHOD0(GetLogicalCPUCount,
int());
MOCK_CONST_METHOD0(GetAssetsPlatform,
const char*());
MOCK_CONST_METHOD0(GetRenderingDriverName,
const char*());
MOCK_METHOD1(DumpMemoryUsageStatistics,
void(bool));
MOCK_METHOD0(Quit,
void());
MOCK_METHOD1(Relaunch,
void(bool bRelaunch));
MOCK_CONST_METHOD0(IsQuitting,
bool());
MOCK_CONST_METHOD0(IsShaderCacheGenMode,
bool());
MOCK_METHOD1(SerializingFile,
void(int mode));
MOCK_CONST_METHOD0(IsSerializingFile,
int());
MOCK_CONST_METHOD0(IsRelaunch,
bool());
MOCK_METHOD4(DisplayErrorMessage,
void(const char*, float, const float*, bool));
void FatalError([[maybe_unused]] const char* sFormat, ...) override {}
void ReportBug([[maybe_unused]] const char* sFormat, ...) override {}
MOCK_METHOD6(WarningV,
void(EValidatorModule module, EValidatorSeverity severity, int flags, const char* file, const char* format, va_list args));
void Warning([[maybe_unused]] EValidatorModule module, [[maybe_unused]] EValidatorSeverity severity, [[maybe_unused]] int flags, [[maybe_unused]] const char* file, [[maybe_unused]] const char* format, ...) override {}
MOCK_METHOD3(ShowMessage,
int(const char* text, const char* caption, unsigned int uType));
MOCK_METHOD1(CheckLogVerbosity,
bool(int verbosity));
MOCK_METHOD0(GetIZLibCompressor,
IZLibCompressor * ());
MOCK_METHOD0(GetIZLibDecompressor,
IZLibDecompressor * ());
MOCK_METHOD0(GetLZ4Decompressor,
ILZ4Decompressor * ());
MOCK_METHOD0(GetZStdDecompressor,
IZStdDecompressor * ());
MOCK_METHOD0(GetPerfHUD,
ICryPerfHUD * ());
MOCK_METHOD0(GetINotificationNetwork,
INotificationNetwork * ());
MOCK_METHOD0(GetIViewSystem,
IViewSystem * ());
MOCK_METHOD0(GetILevelSystem,
ILevelSystem * ());
MOCK_METHOD0(GetINameTable,
INameTable * ());
MOCK_METHOD0(GetIValidator,
IValidator * ());
MOCK_METHOD0(GetStreamEngine,
IStreamEngine * ());
MOCK_METHOD0(GetICmdLine,
ICmdLine * ());
MOCK_METHOD0(GetILog,
ILog * ());
MOCK_METHOD0(GetIPak,
AZ::IO::IArchive * ());
MOCK_METHOD0(GetICryFont,
ICryFont * ());
MOCK_METHOD0(GetIMemoryManager,
IMemoryManager * ());
MOCK_METHOD0(GetIMovieSystem,
IMovieSystem * ());
MOCK_METHOD0(GetIAudioSystem,
Audio::IAudioSystem * ());
MOCK_METHOD0(GetI3DEngine,
I3DEngine * ());
MOCK_METHOD0(GetIConsole,
::IConsole * ());
MOCK_METHOD0(GetIRemoteConsole,
IRemoteConsole * ());
MOCK_METHOD0(GetCrypto,
ICrypto * ());
MOCK_METHOD0(GetIResourceManager,
IResourceManager * ());
MOCK_METHOD0(GetIThreadTaskManager,
IThreadTaskManager * ());
MOCK_METHOD0(GetIProfilingSystem,
IProfilingSystem * ());
MOCK_METHOD0(GetISystemEventDispatcher,
ISystemEventDispatcher * ());
MOCK_METHOD0(GetIVisualLog,
IVisualLog * ());
MOCK_METHOD0(GetIFileChangeMonitor,
IFileChangeMonitor * ());
MOCK_METHOD0(GetHWND,
WIN_HWND());
MOCK_METHOD0(GetIRenderer,
IRenderer * ());
MOCK_METHOD0(GetITimer,
ITimer * ());
MOCK_METHOD0(GetIThreadManager,
IThreadManager * ());
MOCK_METHOD0(GetINetwork,
INetwork * ());
MOCK_METHOD1(SetLoadingProgressListener,
void(ILoadingProgressListener * pListener));
MOCK_CONST_METHOD0(GetLoadingProgressListener,
ISystem::ILoadingProgressListener * ());
MOCK_METHOD1(SetIMaterialEffects,
void(IMaterialEffects * pMaterialEffects));
MOCK_METHOD1(SetIOpticsManager,
void(IOpticsManager * pOpticsManager));
MOCK_METHOD1(SetIFileChangeMonitor,
void(IFileChangeMonitor * pFileChangeMonitor));
MOCK_METHOD1(SetIVisualLog,
void(IVisualLog * pVisualLog));
MOCK_METHOD2(DebugStats,
void(bool checkpoint, bool leaks));
MOCK_METHOD0(DumpWinHeaps,
void());
MOCK_METHOD1(DumpMMStats,
int(bool log));
MOCK_METHOD1(SetForceNonDevMode,
void(bool bValue));
MOCK_CONST_METHOD0(GetForceNonDevMode,
bool());
MOCK_CONST_METHOD0(WasInDevMode,
bool());
MOCK_CONST_METHOD0(IsDevMode,
bool());
MOCK_CONST_METHOD1(IsMODValid,
bool(const char* szMODName));
MOCK_CONST_METHOD0(IsMinimalMode,
bool());
MOCK_METHOD3(CreateXmlNode,
XmlNodeRef(const char*, bool, bool));
MOCK_METHOD4(LoadXmlFromBuffer,
XmlNodeRef(const char*, size_t, bool, bool));
MOCK_METHOD2(LoadXmlFromFile,
XmlNodeRef(const char*, bool));
MOCK_METHOD0(GetXmlUtils,
IXmlUtils * ());
MOCK_CONST_METHOD0(GetArchiveHost,
Serialization::IArchiveHost * ());
MOCK_METHOD1(SetViewCamera,
void(CCamera & Camera));
MOCK_METHOD0(GetViewCamera,
CCamera & ());
MOCK_METHOD1(IgnoreUpdates,
void(bool bIgnore));
MOCK_METHOD1(SetIProcess,
void(IProcess * process));
MOCK_METHOD0(GetIProcess,
IProcess * ());
MOCK_CONST_METHOD0(IsTestMode,
bool());
MOCK_METHOD3(SetFrameProfiler,
void(bool on, bool display, char* prefix));
MOCK_METHOD2(StartLoadingSectionProfiling,
struct SLoadingTimeContainer*(CLoadingTimeProfiler * pProfiler, const char* szFuncName));
MOCK_METHOD1(EndLoadingSectionProfiling,
void(CLoadingTimeProfiler * pProfiler));
MOCK_METHOD2(StartBootSectionProfiler,
CBootProfilerRecord * (const char* name, const char* args));
MOCK_METHOD1(StopBootSectionProfiler,
void(CBootProfilerRecord * record));
MOCK_METHOD1(StartBootProfilerSessionFrames,
void(const char* pName));
MOCK_METHOD0(StopBootProfilerSessionFrames,
void());
MOCK_METHOD0(OutputLoadingTimeStats,
void());
MOCK_METHOD0(GetLoadingProfilerCallstack,
const char*());
MOCK_METHOD0(GetFileVersion,
const SFileVersion&());
MOCK_METHOD0(GetProductVersion,
const SFileVersion&());
MOCK_METHOD0(GetBuildVersion,
const SFileVersion&());
MOCK_METHOD5(CompressDataBlock,
bool(const void*, size_t, void*, size_t &, int));
MOCK_METHOD4(DecompressDataBlock,
bool(const void* input, size_t inputSize, void* output, size_t & outputSize));
MOCK_METHOD1(AddCVarGroupDirectory,
void(const string&));
MOCK_METHOD0(SaveConfiguration,
void());
MOCK_METHOD3(LoadConfiguration,
void(const char*, ILoadConfigurationEntrySink*, bool));
MOCK_METHOD1(GetConfigSpec,
ESystemConfigSpec(bool));
MOCK_CONST_METHOD0(GetMaxConfigSpec,
ESystemConfigSpec());
MOCK_METHOD3(SetConfigSpec,
void(ESystemConfigSpec spec, ESystemConfigPlatform platform, bool bClient));
MOCK_CONST_METHOD0(GetConfigPlatform,
ESystemConfigPlatform());
MOCK_METHOD1(SetConfigPlatform,
void(ESystemConfigPlatform platform));
MOCK_METHOD1(AutoDetectSpec,
void(bool detectResolution));
MOCK_METHOD2(SetThreadState,
int(ESubsystem subsys, bool bActive));
MOCK_METHOD0(CreateSizer,
ICrySizer * ());
MOCK_CONST_METHOD0(IsPaused,
bool());
MOCK_METHOD0(GetLocalizationManager,
ILocalizationManager * ());
MOCK_METHOD0(GetITextModeConsole,
ITextModeConsole * ());
MOCK_METHOD0(GetNoiseGen,
CPNoise3 * ());
MOCK_METHOD0(GetUpdateCounter,
uint64());
MOCK_CONST_METHOD0(GetCryFactoryRegistry,
ICryFactoryRegistry * ());
MOCK_METHOD1(RegisterErrorObserver,
bool(IErrorObserver * errorObserver));
MOCK_METHOD1(UnregisterErrorObserver,
bool(IErrorObserver * errorObserver));
MOCK_METHOD4(OnAssert,
void(const char* condition, const char* message, const char* fileName, unsigned int fileLineNumber));
MOCK_CONST_METHOD0(IsAssertDialogVisible,
bool());
MOCK_METHOD1(SetAssertVisible,
void(bool bAssertVisble));
MOCK_METHOD1(SetConsoleDrawEnabled,
void(bool enabled));
MOCK_METHOD1(SetUIDrawEnabled,
void(bool enabled));
MOCK_METHOD0(GetApplicationInstance,
int());
MOCK_METHOD1(GetApplicationLogInstance,
int(const char* logFilePath));
MOCK_METHOD0(GetCurrentUpdateTimeStats,
sUpdateTimes & ());
MOCK_METHOD2(GetUpdateTimeStats,
const sUpdateTimes * (uint32 &, uint32 &));
MOCK_METHOD0(ClearErrorMessages,
void());
MOCK_METHOD2(debug_GetCallStack,
void(const char** pFunctions, int& nCount));
MOCK_METHOD2(debug_LogCallStack,
void(int, int));
MOCK_METHOD1(ExecuteCommandLine,
void(bool));
MOCK_METHOD1(GetUpdateStats,
void(SSystemUpdateStats & stats));
MOCK_METHOD0(DumpMemoryCoverage,
void());
MOCK_METHOD0(GetSystemGlobalState,
ESystemGlobalState(void));
MOCK_METHOD1(SetSystemGlobalState,
void(ESystemGlobalState systemGlobalState));
MOCK_METHOD5(AsyncMemcpy,
void(void* dst, const void* src, size_t size, int nFlags, volatile int* sync));
#if defined(CVARS_WHITELIST)
MOCK_CONST_METHOD0(GetCVarsWhiteList,
ICVarsWhitelist * ());
#endif
#ifndef _RELEASE
MOCK_METHOD1(GetCheckpointData,
void(ICheckpointData & data));
MOCK_METHOD0(IncreaseCheckpointLoadCount,
void());
MOCK_METHOD1(SetLoadOrigin,
void(LevelLoadOrigin origin));
#endif
#if !defined(_RELEASE)
MOCK_CONST_METHOD0(IsSavingResourceList,
bool());
#endif
MOCK_METHOD0(SteamInit,
bool());
MOCK_CONST_METHOD0(GetImageHandler,
const IImageHandler * ());
MOCK_METHOD3(InitializeEngineModule,
bool(const char* dllName, const char* moduleClassName, const SSystemInitParams&initParams));
MOCK_METHOD2(UnloadEngineModule,
bool(const char* dllName, const char* moduleClassName));
MOCK_METHOD0(GetRootWindowMessageHandler,
void*());
MOCK_METHOD1(RegisterWindowMessageHandler,
void(IWindowMessageHandler * pHandler));
MOCK_METHOD1(UnregisterWindowMessageHandler,
void(IWindowMessageHandler * pHandler));
MOCK_METHOD0(CreateLocalFileIO,
std::shared_ptr<AZ::IO::FileIOBase>());
MOCK_METHOD2(ForceMaxFps, void(bool, int));
};
@@ -0,0 +1,177 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <ITexture.h>
#include <AzTest/AzTest.h>
class ITextureMock
: public ITexture
{
public:
MOCK_METHOD0(AddRef,
int());
MOCK_METHOD0(Release,
int());
MOCK_METHOD0(ReleaseForce,
int());
MOCK_CONST_METHOD0(GetClearColor,
const ColorF& ());
MOCK_CONST_METHOD0(GetDstFormat,
const ETEX_Format());
MOCK_CONST_METHOD0(GetSrcFormat,
const ETEX_Format());
MOCK_CONST_METHOD0(GetTexType,
const ETEX_Type());
MOCK_METHOD2(ApplyTexture,
void(int, int));
MOCK_CONST_METHOD0(GetName,
const char*());
MOCK_CONST_METHOD0(GetWidth,
const int());
MOCK_CONST_METHOD0(GetHeight,
const int());
MOCK_CONST_METHOD0(GetDepth,
const int());
MOCK_CONST_METHOD0(GetTextureID,
const int());
MOCK_CONST_METHOD0(GetFlags,
const uint32());
MOCK_CONST_METHOD0(GetNumMips,
const int());
MOCK_CONST_METHOD0(GetRequiredMip,
const int());
MOCK_CONST_METHOD0(GetDeviceDataSize,
const int());
MOCK_CONST_METHOD0(GetDataSize,
const int());
MOCK_CONST_METHOD0(GetTextureType,
const ETEX_Type());
MOCK_METHOD1(SetTextureType,
void(ETEX_Type type));
MOCK_CONST_METHOD0(IsTextureLoaded,
const bool());
MOCK_METHOD4(PrecacheAsynchronously,
void(float, int, int, int));
MOCK_METHOD4(GetData32,
uint8 * (int nSide, int nLevel, uint8 * pDst, ETEX_Format eDstFormat));
MOCK_METHOD1(SetFilter,
bool(int nFilter));
MOCK_METHOD1(SetClamp,
void(bool bEnable));
MOCK_CONST_METHOD0(GetAvgBrightness,
float());
MOCK_CONST_METHOD1(StreamCalculateMipsSigned,
int(float fMipFactor));
MOCK_CONST_METHOD0(GetStreamableMipNumber,
int());
MOCK_CONST_METHOD1(GetStreamableMemoryUsage,
int(int nStartMip));
MOCK_CONST_METHOD0(GetMinLoadedMip,
int());
MOCK_METHOD2(Readback,
void(AZ::u32 subresourceIndex, StagingHook callback));
MOCK_METHOD0(Reload,
bool());
MOCK_CONST_METHOD0(GetFormatName,
const char*());
MOCK_CONST_METHOD0(GetTypeName,
const char*());
MOCK_CONST_METHOD0(IsStreamedVirtual,
const bool());
MOCK_CONST_METHOD0(IsShared,
const bool());
MOCK_CONST_METHOD0(IsStreamable,
const bool());
MOCK_CONST_METHOD1(IsStreamedIn,
bool(const int nMinPrecacheRoundIds[2]));
MOCK_CONST_METHOD0(GetAccessFrameId,
const int());
MOCK_CONST_METHOD0(GetTextureDstFormat,
const ETEX_Format());
MOCK_CONST_METHOD0(GetTextureSrcFormat,
const ETEX_Format());
MOCK_CONST_METHOD0(IsPostponed,
bool());
MOCK_CONST_METHOD1(IsParticularMipStreamed,
const bool(float fMipFactor));
MOCK_METHOD3(GetLowResSystemCopy,
const ColorB * (uint16 & nWidth, uint16 & nHeight, int** ppLowResSystemCopyAtlasId));
MOCK_METHOD1(SetKeepSystemCopy,
void(const bool bKeepSystemCopy));
MOCK_METHOD8(UpdateTextureRegion,
void(const uint8_t * data, int nX, int nY, int nZ, int USize, int VSize, int ZSize, ETEX_Format eTFSrc));
MOCK_CONST_METHOD0(GetDevTexture,
CDeviceTexture * ());
};
class ITextureLoadHandlerMock
: public ITextureLoadHandler
{
public:
MOCK_METHOD2(LoadTextureData,
bool(const char* path, STextureLoadData & loadData));
MOCK_CONST_METHOD1(SupportsExtension,
bool(const char* ext));
MOCK_METHOD0(Update,
void());
};
class IDynTextureMock
: public IDynTexture
{
public:
MOCK_METHOD0(Release,
void());
MOCK_METHOD4(GetSubImageRect,
void(uint32 & nX, uint32 & nY, uint32 & nWidth, uint32 & nHeight));
MOCK_METHOD4(GetImageRect,
void(uint32 & nX, uint32 & nY, uint32 & nWidth, uint32 & nHeight));
MOCK_METHOD0(GetTextureID,
int());
MOCK_METHOD0(Lock,
void());
MOCK_METHOD0(UnLock,
void());
MOCK_METHOD0(GetWidth,
int());
MOCK_METHOD0(GetHeight,
int());
MOCK_METHOD0(IsValid,
bool());
MOCK_CONST_METHOD0(GetFlags,
uint8());
MOCK_METHOD1(SetFlags,
void(uint8 flags));
MOCK_METHOD2(Update,
bool(int nNewWidth, int nNewHeight));
MOCK_METHOD2(Apply,
void(int, int));
MOCK_METHOD0(ClearRT,
bool());
MOCK_METHOD4(SetRT,
bool(int nRT, bool bPush, struct SDepthTexture* pDepthSurf, bool bScreenVP));
MOCK_METHOD0(SetRectStates,
bool());
MOCK_METHOD2(RestoreRT,
bool(int nRT, bool bPop));
MOCK_METHOD0(GetTexture,
ITexture * ());
MOCK_METHOD0(SetUpdateMask,
void());
MOCK_METHOD0(ResetUpdateMask,
void());
MOCK_METHOD0(IsSecondFrame,
bool());
MOCK_METHOD2(GetImageData32,
bool(uint8 * pData, int nDataSize));
};
@@ -0,0 +1,55 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#ifndef CRYINCLUDE_CRYSYSTEM_ITIMERMOCK_H
#define CRYINCLUDE_CRYSYSTEM_ITIMERMOCK_H
#pragma once
#include <ISerialize.h>
#include <ITimer.h>
#include <AzTest/AzTest.h>
// Implements all common timing routines
class TimerMock
: public ITimer
{
public:
MOCK_METHOD0(ResetTimer, void());
MOCK_METHOD0(UpdateOnFrameStart, void());
MOCK_CONST_METHOD1(GetCurrTime, float(ETimer which));
MOCK_CONST_METHOD0(GetAsyncTime, CTimeValue());
MOCK_METHOD0(GetAsyncCurTime, float());
MOCK_CONST_METHOD1(GetFrameTime, float(ETimer which));
MOCK_CONST_METHOD0(GetRealFrameTime, float());
MOCK_CONST_METHOD0(GetTimeScale, float());
MOCK_CONST_METHOD1(GetTimeScale, float(uint32 channel));
MOCK_METHOD2(SetTimeScale, void(float scale, uint32 channel));
MOCK_METHOD0(ClearTimeScales, void());
MOCK_METHOD1(EnableTimer, void(bool bEnable));
MOCK_METHOD0(GetFrameRate, float());
MOCK_METHOD2(GetProfileFrameBlending, float(float* pfBlendTime, int* piBlendMode));
MOCK_METHOD1(Serialize, void(TSerialize ser));
MOCK_CONST_METHOD0(IsTimerEnabled, bool());
MOCK_METHOD2(PauseTimer, bool(ETimer which, bool bPause));
MOCK_METHOD1(IsTimerPaused, bool(ETimer which));
MOCK_METHOD2(SetTimer, bool(ETimer which, float timeInSeconds));
MOCK_METHOD2(SecondsToDateUTC, void(time_t time, struct tm& outDateUTC));
MOCK_METHOD1(DateToSecondsUTC, time_t(struct tm& timePtr));
MOCK_METHOD1(TicksToSeconds, float(int64 ticks));
MOCK_METHOD0(GetTicksPerSecond, int64());
MOCK_CONST_METHOD1(GetFrameStartTime, const CTimeValue&(ETimer which));
MOCK_METHOD0(CreateNewTimer, ITimer * ());
MOCK_METHOD2(EnableFixedTimeMode, void(bool enable, float timeStep));
};
#endif // CRYINCLUDE_CRYSYSTEM_ITIMERMOCK_H
@@ -0,0 +1,29 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzTest/AzTest.h>
#include <CGFContent.h>
class MockIAssetWriter
: public IAssetWriter
{
public:
~MockIAssetWriter() override = default;
MOCK_METHOD1(WriteCGF,
bool(CContentCGF* content));
MOCK_METHOD2(WriteCHR,
bool(CContentCGF* content, IConvertContext* convertContext));
MOCK_METHOD3(WriteSKIN,
bool(CContentCGF* content, IConvertContext* convertContext, bool exportMorphTargets));
};
+113
View File
@@ -0,0 +1,113 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
//! Simple stub timer that exposes a single simple interface for setting the current time.
class StubTimer
: public ITimer
{
public:
// Stub methods
void SetTime(float seconds)
{
m_frameStartTime.SetSeconds(seconds);
}
//~Stub methods
StubTimer(float frameTime)
: m_frameTime(frameTime)
, m_frameRate(1.0f / frameTime)
, m_frameStartTime(0.0f)
{
}
virtual ~StubTimer() {};
// ITimer
void ResetTimer() override {}
void UpdateOnFrameStart() override {}
float GetCurrTime([[maybe_unused]] ETimer which = ETIMER_GAME) const override
{
// return the same as the frame start time
return m_frameStartTime.GetSeconds();
}
const CTimeValue& GetFrameStartTime([[maybe_unused]] ETimer which = ETIMER_GAME) const override
{
return m_frameStartTime;
}
CTimeValue GetAsyncTime() const override
{
return m_frameStartTime;
}
float GetAsyncCurTime() override
{
return m_frameStartTime.GetSeconds();
}
float GetFrameTime([[maybe_unused]] ETimer which = ETIMER_GAME) const override
{
return m_frameTime;
}
float GetRealFrameTime() const override
{
return m_frameTime;
}
float GetTimeScale() const override
{
return 1.0f;
}
float GetTimeScale([[maybe_unused]] uint32 channel) const override
{
return 1.0f;
}
void ClearTimeScales() override {}
void SetTimeScale([[maybe_unused]] float s, [[maybe_unused]] uint32 channel = 0) override {}
void EnableTimer([[maybe_unused]] bool bEnable) override {}
bool IsTimerEnabled() const override
{
return true;
}
float GetFrameRate() override
{
return m_frameRate;
}
float GetProfileFrameBlending([[maybe_unused]] float* pfBlendTime = 0, [[maybe_unused]] int* piBlendMode = 0) override
{
return 0.0f;
}
void Serialize([[maybe_unused]] TSerialize ser) override {}
bool PauseTimer([[maybe_unused]] ETimer which, [[maybe_unused]] bool bPause) override { return false; }
bool IsTimerPaused([[maybe_unused]] ETimer which) override { return false; }
bool SetTimer([[maybe_unused]] ETimer which, [[maybe_unused]] float timeInSeconds) override { return false; }
void SecondsToDateUTC([[maybe_unused]] time_t time, [[maybe_unused]] struct tm& outDateUTC) override {}
time_t DateToSecondsUTC([[maybe_unused]] struct tm& timePtr) override
{
return 0;
}
float TicksToSeconds([[maybe_unused]] int64 ticks) override
{
return 0.0f;
}
int64 GetTicksPerSecond() override
{
return 0;
}
ITimer* CreateNewTimer() override
{
return nullptr;
}
void EnableFixedTimeMode([[maybe_unused]] bool enable, [[maybe_unused]] float timeStep) override {}
// ~ITimer
private:
CTimeValue m_frameStartTime;
float m_frameTime;
float m_frameRate;
};