SystemTimeParameterTest.cpp 985 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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-15
  7. *
  8. * */
  9. #include <gtest/gtest.h>
  10. #include <ls-std/ls-std-time.hpp>
  11. #include <memory>
  12. using ls::std::time::PosixClock;
  13. using ls::std::time::SystemTimeParameter;
  14. using std::make_shared;
  15. using std::shared_ptr;
  16. using testing::Test;
  17. namespace
  18. {
  19. class SystemTimeParameterTest : public Test
  20. {
  21. public:
  22. SystemTimeParameterTest() = default;
  23. ~SystemTimeParameterTest() override = default;
  24. };
  25. TEST_F(SystemTimeParameterTest, getPosixClock)
  26. {
  27. ASSERT_TRUE(SystemTimeParameter{}.getPosixClock() == nullptr);
  28. }
  29. TEST_F(SystemTimeParameterTest, setPosixClock)
  30. {
  31. SystemTimeParameter parameter{};
  32. shared_ptr<PosixClock> posixClock = make_shared<PosixClock>();
  33. parameter.setPosixClock(posixClock);
  34. ASSERT_TRUE(parameter.getPosixClock() == posixClock);
  35. }
  36. }