Commit d9cf2a4e authored by hlgr's avatar hlgr
Browse files

fixed data generator bug and add phtreads to tests

parent 2b83789c
......@@ -56,4 +56,6 @@ target_include_directories(macrobenchmark SYSTEM PUBLIC ${CO572CW1_BINARY_DIR}/d
add_executable(tests tests.cpp solution.c)
add_dependencies(tests catch2)
set_property(TARGET tests PROPERTY CXX_STANDARD 14)
target_link_libraries(tests Threads::Threads)
target_include_directories(tests SYSTEM PUBLIC ${CO572CW1_BINARY_DIR}/deps/include)
......@@ -73,6 +73,11 @@ void GenerateData(Database& db, size_t itemsCardinality = 16384) {
itemsCursor++;
}
}
for (; itemsCursor < db.itemsCardinality; itemsCursor++) {
db.items[itemsCursor].salesDate = db.orders[db.ordersCardinality-1].salesDate;
db.items[itemsCursor].employee = db.orders[db.ordersCardinality-1].employee;
db.items[itemsCursor].price = lcg() % numberOfUniquePrices;
}
std::lognormal_distribution<double> distribution(.3, .8);
for(size_t i = 0; i < db.itemsCardinality; i++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment