| 4 | using namespace PS; |
| 5 | |
| 6 | TEST(FIXING_FLOAT, EncodeDecode) { |
| 7 | MessagePtr msg(new Message()); |
| 8 | auto filter_conf = msg->addFilter(FilterConfig::FIXING_FLOAT); |
| 9 | auto conf = filter_conf->add_fixed_point(); |
| 10 | conf->set_min_value(-90); |
| 11 | conf->set_max_value(90); |
| 12 | conf->set_num_bytes(3); |
| 13 | |
| 14 | conf = filter_conf->add_fixed_point(); |
| 15 | conf->set_num_bytes(3); |
| 16 | |
| 17 | SArray<float> ax = {100.0, .1, -100.0}; msg->addValue(ax); |
| 18 | SArray<double> bx = {100.0, .1, -100.0}; msg->addValue(bx); |
| 19 | |
| 20 | FixingFloatFilter filter; |
| 21 | filter.encode(msg); |
| 22 | filter.decode(msg); |
| 23 | |
| 24 | LL << SArray<float>(msg->value[0]); |
| 25 | LL << SArray<double>(msg->value[1]); |
| 26 | } |
| 27 | |
| 28 | |
| 29 | TEST(FIXING_FLOAT, Error) { |
nothing calls this directly
no test coverage detected