DataFixture::generateFixedSize()

This commit is contained in:
Sebastian Messmer 2015-10-24 01:53:11 +02:00
parent 6e4ecd6e19
commit 60b7f853d9

View File

@ -3,14 +3,25 @@
#define MESSMER_CPPUTILS_DATA_DATAFIXTURE_H_
#include "Data.h"
#include "FixedSizeData.h"
namespace cpputils {
class DataFixture {
public:
static Data generate(size_t size, long long int seed = 1);
//TODO Test
template<size_t SIZE> static FixedSizeData<SIZE> generateFixedSize(long long int seed = 1);
};
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;
}
}
#endif