ISystemMock.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <ISystem.h>
  10. #ifdef GetUserName
  11. #undef GetUserName
  12. #endif
  13. class SystemMock
  14. : public ISystem
  15. {
  16. public:
  17. MOCK_METHOD0(Release,
  18. void());
  19. MOCK_METHOD0(GetGlobalEnvironment,
  20. SSystemGlobalEnvironment * ());
  21. MOCK_METHOD2(UpdatePreTickBus,
  22. bool(int, int));
  23. MOCK_METHOD2(UpdatePostTickBus,
  24. bool(int, int));
  25. MOCK_METHOD0(UpdateLoadtime,
  26. bool());
  27. MOCK_METHOD0(RenderStatistics,
  28. void());
  29. MOCK_METHOD0(GetUserName,
  30. const char*());
  31. MOCK_METHOD0(Quit,
  32. void());
  33. MOCK_METHOD1(Relaunch,
  34. void(bool bRelaunch));
  35. MOCK_CONST_METHOD0(IsQuitting,
  36. bool());
  37. MOCK_METHOD1(SerializingFile,
  38. void(int mode));
  39. MOCK_CONST_METHOD0(IsSerializingFile,
  40. int());
  41. MOCK_CONST_METHOD0(IsRelaunch,
  42. bool());
  43. void FatalError([[maybe_unused]] const char* sFormat, ...) override {}
  44. void ReportBug([[maybe_unused]] const char* sFormat, ...) override {}
  45. MOCK_METHOD6(WarningV,
  46. void(EValidatorModule module, EValidatorSeverity severity, int flags, const char* file, const char* format, va_list args));
  47. 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 {}
  48. MOCK_METHOD3(ShowMessage,
  49. void(const char* text, const char* caption, unsigned int uType));
  50. MOCK_METHOD1(CheckLogVerbosity,
  51. bool(int verbosity));
  52. MOCK_METHOD0(GetILevelSystem,
  53. ILevelSystem * ());
  54. MOCK_METHOD0(GetICmdLine,
  55. ICmdLine * ());
  56. MOCK_METHOD0(GetILog,
  57. ILog * ());
  58. MOCK_METHOD0(GetIPak,
  59. AZ::IO::IArchive * ());
  60. MOCK_METHOD0(GetICryFont,
  61. ICryFont * ());
  62. MOCK_METHOD0(GetIMovieSystem,
  63. IMovieSystem * ());
  64. MOCK_METHOD0(GetIConsole,
  65. ::IConsole * ());
  66. MOCK_METHOD0(GetIRemoteConsole,
  67. IRemoteConsole * ());
  68. MOCK_METHOD0(GetISystemEventDispatcher,
  69. ISystemEventDispatcher * ());
  70. MOCK_CONST_METHOD0(IsDevMode,
  71. bool());
  72. MOCK_METHOD3(CreateXmlNode,
  73. XmlNodeRef(const char*, bool, bool));
  74. MOCK_METHOD4(LoadXmlFromBuffer,
  75. XmlNodeRef(const char*, size_t, bool, bool));
  76. MOCK_METHOD2(LoadXmlFromFile,
  77. XmlNodeRef(const char*, bool));
  78. MOCK_METHOD0(GetXmlUtils,
  79. IXmlUtils * ());
  80. MOCK_METHOD1(IgnoreUpdates,
  81. void(bool bIgnore));
  82. MOCK_CONST_METHOD0(IsTestMode,
  83. bool());
  84. MOCK_METHOD3(SetFrameProfiler,
  85. void(bool on, bool display, char* prefix));
  86. MOCK_METHOD0(GetFileVersion,
  87. const SFileVersion&());
  88. MOCK_METHOD0(GetProductVersion,
  89. const SFileVersion&());
  90. MOCK_METHOD0(GetBuildVersion,
  91. const SFileVersion&());
  92. MOCK_METHOD1(AddCVarGroupDirectory,
  93. void(const AZStd::string&));
  94. MOCK_METHOD0(SaveConfiguration,
  95. void());
  96. MOCK_METHOD3(LoadConfiguration,
  97. void(const char*, ILoadConfigurationEntrySink*, bool));
  98. MOCK_CONST_METHOD0(GetConfigPlatform,
  99. ESystemConfigPlatform());
  100. MOCK_METHOD1(SetConfigPlatform,
  101. void(ESystemConfigPlatform platform));
  102. MOCK_CONST_METHOD0(IsPaused,
  103. bool());
  104. MOCK_METHOD0(GetLocalizationManager,
  105. ILocalizationManager * ());
  106. MOCK_METHOD1(RegisterErrorObserver,
  107. bool(IErrorObserver * errorObserver));
  108. MOCK_METHOD1(UnregisterErrorObserver,
  109. bool(IErrorObserver * errorObserver));
  110. MOCK_METHOD4(OnAssert,
  111. void(const char* condition, const char* message, const char* fileName, unsigned int fileLineNumber));
  112. MOCK_CONST_METHOD0(IsAssertDialogVisible,
  113. bool());
  114. MOCK_METHOD1(SetAssertVisible,
  115. void(bool bAssertVisble));
  116. MOCK_METHOD0(GetApplicationInstance,
  117. int());
  118. MOCK_METHOD1(GetApplicationLogInstance,
  119. int(const char* logFilePath));
  120. MOCK_METHOD0(ClearErrorMessages,
  121. void());
  122. MOCK_METHOD2(debug_GetCallStack,
  123. void(const char** pFunctions, int& nCount));
  124. MOCK_METHOD2(debug_LogCallStack,
  125. void(int, int));
  126. MOCK_METHOD1(ExecuteCommandLine,
  127. void(bool));
  128. MOCK_METHOD1(GetUpdateStats,
  129. void(SSystemUpdateStats & stats));
  130. MOCK_METHOD0(GetSystemGlobalState,
  131. ESystemGlobalState(void));
  132. MOCK_METHOD1(SetSystemGlobalState,
  133. void(ESystemGlobalState systemGlobalState));
  134. #if !defined(_RELEASE)
  135. MOCK_CONST_METHOD0(IsSavingResourceList,
  136. bool());
  137. #endif
  138. MOCK_METHOD1(RegisterWindowMessageHandler,
  139. void(IWindowMessageHandler * pHandler));
  140. MOCK_METHOD1(UnregisterWindowMessageHandler,
  141. void(IWindowMessageHandler * pHandler));
  142. MOCK_METHOD2(ForceMaxFps, void(bool, int));
  143. };