randomTests.cpp 488 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * randomTests.cpp
  3. *
  4. * Created on: Dec 16, 2013
  5. * Author: mmm
  6. */
  7. #include <CppUTest/TestHarness.h>
  8. #include <stdint.h>
  9. extern "C" {
  10. #include <random.h>
  11. #include <xorshiftrandom.h>
  12. }
  13. TEST_GROUP(RandomClass)
  14. {
  15. };
  16. TEST(RandomClass, CreateXOrShiftObject)
  17. {
  18. Random* pRandom;
  19. uint32_t nResult = 0;
  20. pRandom = random_new(SetXorShiftSeed, NextXorShiftUint32);
  21. POINTERS_EQUAL(SetXorShiftSeed, pRandom->setSeed);
  22. POINTERS_EQUAL(NextXorShiftUint32, pRandom->getNextUInt32);
  23. }