randomTests.cpp 689 B

1234567891011121314151617181920212223242526272829
  1. /*******************************************************************************
  2. * Copyright (c) 2015, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #include <CppUTest/TestHarness.h>
  7. #include <stdint.h>
  8. extern "C" {
  9. #include <random.h>
  10. #include <xorshiftrandom.h>
  11. }
  12. TEST_GROUP(RandomClass)
  13. {
  14. };
  15. TEST(RandomClass, CreateXOrShiftObject)
  16. {
  17. Random *pRandom = NULL;
  18. uint32_t nResult = 0;
  19. pRandom = RandomNew(SetXorShiftSeed, NextXorShiftUint32);
  20. POINTERS_EQUAL(SetXorShiftSeed, pRandom->set_seed);
  21. POINTERS_EQUAL(NextXorShiftUint32, pRandom->get_next_uint32);
  22. RandomDelete(&pRandom);
  23. }