16 using quantities_t = std::array<unsigned, quantity::n>;
19 test_statistics_quantities(
sqlite3*
const db,
22 quantities_t
const& expected_values)
24 assert(cet::sqlite::min<unsigned>(db, table_name, column_name) ==
26 assert(cet::sqlite::max<unsigned>(db, table_name, column_name) ==
36 db, table_name, column_name)) == expected_values[
quantity::rms]);
51 *
c, table_name, {{
"Name",
"Age",
"Experience"}}};
53 workers.insert(
"Benny", 48, 10);
54 workers.insert(
"Cassie", 52, 27);
55 workers.insert(
"David", 65, 14);
56 workers.insert(
"Emily", 38, 19);
58 test_statistics_quantities(
59 *
c, table_name,
"Age", {{27, 65, 46, 48, 12 }});
60 test_statistics_quantities(
61 *
c, table_name,
"Experience", {{5, 27, 15, 14, 7 }});
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
auto make_connection(std::string const &file_name, PolicyArgs &&...) -> Connection *
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
double median(sqlite3 *db, std::string const &table_name, std::string const &column_name)