BsEditorTestSuite.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 "BsTestSuite.h"
  6. #include "BsComponent.h"
  7. namespace BansheeEngine
  8. {
  9. class TestComponentA : public Component
  10. {
  11. public:
  12. HSceneObject ref1;
  13. HComponent ref2;
  14. /************************************************************************/
  15. /* COMPONENT OVERRIDES */
  16. /************************************************************************/
  17. protected:
  18. friend class SceneObject;
  19. TestComponentA(const HSceneObject& parent);
  20. /************************************************************************/
  21. /* RTTI */
  22. /************************************************************************/
  23. public:
  24. friend class TestComponentARTTI;
  25. static RTTITypeBase* getRTTIStatic();
  26. virtual RTTITypeBase* getRTTI() const;
  27. protected:
  28. TestComponentA() {} // Serialization only
  29. };
  30. class TestComponentB : public Component
  31. {
  32. public:
  33. HSceneObject ref1;
  34. String val1;
  35. /************************************************************************/
  36. /* COMPONENT OVERRIDES */
  37. /************************************************************************/
  38. protected:
  39. friend class SceneObject;
  40. TestComponentB(const HSceneObject& parent);
  41. /************************************************************************/
  42. /* RTTI */
  43. /************************************************************************/
  44. public:
  45. friend class TestComponentBRTTI;
  46. static RTTITypeBase* getRTTIStatic();
  47. virtual RTTITypeBase* getRTTI() const;
  48. protected:
  49. TestComponentB() {} // Serialization only
  50. };
  51. /**
  52. * @brief Contains a set of unit tests for the editor.
  53. */
  54. class EditorTestSuite : public TestSuite
  55. {
  56. public:
  57. EditorTestSuite();
  58. private:
  59. /**
  60. * @brief Tests SceneObject record undo/redo operation.
  61. */
  62. void SceneObjectRecord_UndoRedo();
  63. /**
  64. * @brief Tests SceneObject delete undo/redo operation.
  65. */
  66. void SceneObjectDelete_UndoRedo();
  67. /**
  68. * @brief Tests native diff by modifiying an object, generating a diff
  69. * and re-applying the modifications.
  70. */
  71. void BinaryDiff();
  72. /**
  73. * @brief Tests prefab diff by modifiying a prefab, generating a diff
  74. * and re-applying the modifications.
  75. */
  76. void TestPrefabDiff();
  77. /**
  78. * @brief Tests the frame allocator.
  79. */
  80. void TestFrameAlloc();
  81. };
  82. }