randomTests.cpp 696 B

1234567891011121314151617181920212223242526
  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. TEST(RandomClass, CreateXOrShiftObject) {
  15. Random* pRandom = NULL;
  16. uint32_t nResult = 0;
  17. pRandom = RandomNew(SetXorShiftSeed, NextXorShiftUint32);
  18. POINTERS_EQUAL(SetXorShiftSeed, pRandom->set_seed);
  19. POINTERS_EQUAL(NextXorShiftUint32, pRandom->get_next_uint32);
  20. RandomDelete(&pRandom);
  21. }