BsEditorTestSuite.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 native diff by modifiying an object, generating a diff
  63. * and re-applying the modifications.
  64. */
  65. void BinaryDiff();
  66. /**
  67. * @brief Tests prefab diff by modifiying a prefab, generating a diff
  68. * and re-applying the modifications.
  69. */
  70. void TestPrefabDiff();
  71. /**
  72. * @brief Tests the frame allocator.
  73. */
  74. void TestFrameAlloc();
  75. };
  76. }