socket_timer_tests.cpp 711 B

123456789101112131415161718192021222324252627282930
  1. /*******************************************************************************
  2. * Copyright (c) 2016, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #include <CppUTest/TestHarness.h>
  7. #include <stdint.h>
  8. #include <string.h>
  9. extern "C" {
  10. #include "socket_timer.h"
  11. }
  12. TEST_GROUP(SocketTimer) {
  13. };
  14. TEST(SocketTimer, GetAvailableEmptySocketTimer) {
  15. SocketTimer timers[10];
  16. SocketTimerArrayInitialize(timers, 10);
  17. POINTERS_EQUAL( &timers[0], GetEmptySocketTimer(timers, 10) );
  18. }
  19. TEST(SocketTimer, NoEmptySocketTimerAvailable) {
  20. SocketTimer timers[10];
  21. POINTERS_EQUAL( NULL, GetEmptySocketTimer(timers, 10) );
  22. }