5 #include "../algo-common.h" 16 auto raw_data = original_table.build_raw_data();
18 REQUIRE( original_table == table_from_raw );
21 TEST_CASE(
"invalid thermal table",
"[thermal-loop]" )
24 table._header.valid = 0.f;
26 auto raw_data =
table.build_raw_data();
30 TEST_CASE(
"data_size_too_small",
"[thermal-loop]" )
33 auto raw_data = syntetic_table.build_raw_data();
38 TEST_CASE(
"data_size_too_large",
"[thermal-loop]" )
41 auto raw_data = syntetic_table.build_raw_data();
42 raw_data.push_back( 1 );
49 auto raw_data = syntetic_table.build_raw_data();
51 std::vector< byte > raw;
53 raw.insert( raw.end(),
54 (
byte *)&( syntetic_table._header.min_temp ),
55 (
byte *)&( syntetic_table._header.min_temp ) + 4 );
57 raw.insert( raw.end(),
58 (
byte *)&( syntetic_table._header.max_temp ),
59 (
byte *)&( syntetic_table._header.max_temp ) + 4 );
61 raw.insert( raw.end(),
62 (
byte *)&( syntetic_table._header.reference_temp ),
63 (
byte *)&( syntetic_table._header.reference_temp ) + 4 );
65 raw.insert( raw.end(),
66 (
byte *)&( syntetic_table._header.valid ),
67 (
byte *)&( syntetic_table._header.valid ) + 4 );
69 for (
auto v : syntetic_table.bins)
71 raw.insert( raw.end(),
73 (
byte *)&(
v.scale ) + 4 );
75 raw.insert( raw.end(), (
byte *)&(
v.sheer ), (
byte *)&(
v.sheer ) + 4 );
76 raw.insert( raw.end(), (
byte *)&(
v.tx ), (
byte *)&(
v.tx ) + 4 );
77 raw.insert( raw.end(), (
byte *)&(
v.ty ), (
byte *)&(
v.ty ) + 4 );
80 CHECK( raw_data == raw );
84 TEST_CASE(
"build_raw_data_no_data",
"[thermal-loop]" )
87 auto raw_data = syntetic_table.build_raw_data();
TEST_CASE("parse_thermal_table","[thermal-loop]")
thermal::thermal_calibration_table create_synthetic_table(const int table_size=29, float min_temp=0, float max_temp=75)
std::vector< thermal_bin > bins
#define REQUIRE_THROWS(...)
GLenum GLenum GLsizei void * table