BsEditorTestSuite.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "Testing/BsTestSuite.h"
  6. #include "Scene/BsComponent.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Testing-Editor
  10. * @{
  11. */
  12. /** @cond TEST */
  13. class TestComponentA : public Component
  14. {
  15. public:
  16. HSceneObject ref1;
  17. HComponent ref2;
  18. /************************************************************************/
  19. /* COMPONENT OVERRIDES */
  20. /************************************************************************/
  21. protected:
  22. friend class SceneObject;
  23. TestComponentA(const HSceneObject& parent);
  24. /************************************************************************/
  25. /* RTTI */
  26. /************************************************************************/
  27. public:
  28. friend class TestComponentARTTI;
  29. static RTTITypeBase* getRTTIStatic();
  30. RTTITypeBase* getRTTI() const override;
  31. protected:
  32. TestComponentA() {} // Serialization only
  33. };
  34. class TestComponentB : public Component
  35. {
  36. public:
  37. HSceneObject ref1;
  38. String val1;
  39. /************************************************************************/
  40. /* COMPONENT OVERRIDES */
  41. /************************************************************************/
  42. protected:
  43. friend class SceneObject;
  44. TestComponentB(const HSceneObject& parent);
  45. /************************************************************************/
  46. /* RTTI */
  47. /************************************************************************/
  48. public:
  49. friend class TestComponentBRTTI;
  50. static RTTITypeBase* getRTTIStatic();
  51. RTTITypeBase* getRTTI() const override;
  52. protected:
  53. TestComponentB() {} // Serialization only
  54. };
  55. /** @endcond */
  56. /** Contains a set of unit tests for the editor. */
  57. class EditorTestSuite : public TestSuite
  58. {
  59. public:
  60. EditorTestSuite();
  61. private:
  62. /** Tests SceneObject record undo/redo operation. */
  63. void SceneObjectRecord_UndoRedo();
  64. /** Tests SceneObject delete undo/redo operation. */
  65. void SceneObjectDelete_UndoRedo();
  66. /** Tests native diff by modifiying an object, generating a diff and re-applying the modifications. */
  67. void BinaryDiff();
  68. /** Tests prefab diff by modifiying a prefab, generating a diff and re-applying the modifications. */
  69. void TestPrefabDiff();
  70. /** Tests a complex set of operations on a prefab. */
  71. void TestPrefabComplex();
  72. /** Tests the frame allocator. */
  73. void TestFrameAlloc();
  74. };
  75. /** @} */
  76. }