BsEditorTestSuite.h 2.4 KB

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