2015-04-25 13:20:26 +02:00
|
|
|
#pragma once
|
2015-10-15 12:58:16 +02:00
|
|
|
#ifndef MESSMER_CPPUTILS_DATA_DATAFIXTURE_H_
|
|
|
|
#define MESSMER_CPPUTILS_DATA_DATAFIXTURE_H_
|
2015-04-25 13:20:26 +02:00
|
|
|
|
|
|
|
#include "Data.h"
|
2015-10-24 01:53:11 +02:00
|
|
|
#include "FixedSizeData.h"
|
2015-04-25 13:20:26 +02:00
|
|
|
|
|
|
|
namespace cpputils {
|
|
|
|
|
|
|
|
class DataFixture {
|
|
|
|
public:
|
|
|
|
static Data generate(size_t size, long long int seed = 1);
|
2015-10-24 01:53:11 +02:00
|
|
|
|
|
|
|
//TODO Test
|
|
|
|
template<size_t SIZE> static FixedSizeData<SIZE> generateFixedSize(long long int seed = 1);
|
2015-04-25 13:20:26 +02:00
|
|
|
};
|
|
|
|
|
2015-10-24 01:53:11 +02:00
|
|
|
template<size_t SIZE> FixedSizeData<SIZE> DataFixture::generateFixedSize(long long int seed) {
|
|
|
|
Data data = generate(SIZE, seed);
|
|
|
|
auto result = FixedSizeData<SIZE>::Null();
|
|
|
|
std::memcpy(result.data(), data.data(), SIZE);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2015-04-25 13:20:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|