SystemTimeParameterTest.cpp 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-03-15
  6. * Changed: 2023-03-31
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls-std/ls-std-time.hpp>
  11. #include <memory>
  12. using ls::std::time::IClock;
  13. using ls::std::time::PosixClock;
  14. using ls::std::time::SystemTimeParameter;
  15. using std::make_shared;
  16. using std::shared_ptr;
  17. using testing::Test;
  18. namespace
  19. {
  20. class SystemTimeParameterTest : public Test
  21. {
  22. public:
  23. SystemTimeParameterTest() = default;
  24. ~SystemTimeParameterTest() override = default;
  25. };
  26. TEST_F(SystemTimeParameterTest, getClock)
  27. {
  28. ASSERT_TRUE(SystemTimeParameter{}.getClock() == nullptr);
  29. }
  30. TEST_F(SystemTimeParameterTest, setClock)
  31. {
  32. SystemTimeParameter parameter{};
  33. shared_ptr<IClock> posixClock = make_shared<PosixClock>();
  34. parameter.setClock(posixClock);
  35. ASSERT_TRUE(parameter.getClock() == posixClock);
  36. }
  37. }