MCPcopy Create free account
hub / github.com/dmlc/parameter_server / TEST

Function TEST

src/test/fixing_float_test.cc:6–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace PS;
5
6TEST(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
29TEST(FIXING_FLOAT, Error) {

Callers

nothing calls this directly

Calls 8

addFilterMethod · 0.80
add_fixed_pointMethod · 0.80
set_min_valueMethod · 0.80
set_max_valueMethod · 0.80
set_num_bytesMethod · 0.80
addValueMethod · 0.45
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected