Added tests for band helper

This commit is contained in:
David Rupprecht 2021-04-28 10:30:10 +02:00 committed by Andre Puschmann
parent 937c4ff3c3
commit bde30bb9be
1 changed files with 28 additions and 0 deletions

View File

@ -20,6 +20,34 @@ int bands_test_nr()
TESTASSERT(bands.nr_arfcn_to_freq(632628) == 3489.42e6);
TESTASSERT(bands.nr_arfcn_to_freq(633928) == 3508.92e6); // default refPointA
TESTASSERT(bands.nr_arfcn_to_freq(634240) == 3513.6e6); // default ARFCN with freq divisible by 11.52 MHz
// b28 b67
TESTASSERT(bands.nr_arfcn_to_freq(140600) == 703.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(145800) == 729.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(153600) == 768.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(157600) == 788.0e6);
// b20
TESTASSERT(bands.nr_arfcn_to_freq(158200) == 791.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(160200) == 801.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(162200) == 811.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(168400) == 842.0e6);
// b32 b75
TESTASSERT(bands.nr_arfcn_to_freq(290400) == 1452.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(294400) == 1472.0e6);
// b3
TESTASSERT(bands.nr_arfcn_to_freq(342000) == 1710.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(348000) == 1740.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(361000) == 1805.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(376000) == 1880.0e6);
// b1
TESTASSERT(bands.nr_arfcn_to_freq(384000) == 1920.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(388030) == 1940.15e6);
TESTASSERT(bands.nr_arfcn_to_freq(391830) == 1959.15e6);
TESTASSERT(bands.nr_arfcn_to_freq(434000) == 2170.0e6);
// b7 b38
TESTASSERT(bands.nr_arfcn_to_freq(500000) == 2500.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(508000) == 2540.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(522000) == 2610.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(538000) == 2690.0e6);
const uint32_t max_valid_nr_arfcn = 3279165;