mirror of
https://github.com/Genaker/LoraSA.git
synced 2026-06-30 15:01:37 +02:00
Address review comments from PR 40
This commit is contained in:
+7
-6
@@ -9,7 +9,7 @@ void tearDown(void) {}
|
||||
|
||||
struct TestScan : Scan
|
||||
{
|
||||
TestScan(float *ctx, int sz) : Scan(sz), ctx(ctx), sz(sz), idx(0) {}
|
||||
TestScan(float *ctx, int sz) : ctx(ctx), sz(sz), idx(0) {}
|
||||
|
||||
float getRSSI() override;
|
||||
|
||||
@@ -29,18 +29,19 @@ float TestScan::getRSSI()
|
||||
}
|
||||
|
||||
constexpr int test_sz = 13;
|
||||
constexpr int inputs_sz = 13;
|
||||
|
||||
void test_rssi(void)
|
||||
{
|
||||
uint16_t samples[test_sz];
|
||||
float inputs[] = {-40.0, -100.0, -200.0, -50.0, -400.0, -60.0, -20,
|
||||
-75.5, -70, -80, -90, -55.9, -110};
|
||||
float inputs[inputs_sz] = {-40.0, -100.0, -200.0, -50.0, -400.0, -60.0, -20,
|
||||
-75.5, -70, -80, -90, -55.9, -110};
|
||||
|
||||
TestScan t = TestScan(inputs, test_sz);
|
||||
TestScan t = TestScan(inputs, inputs_sz);
|
||||
|
||||
uint16_t r = t.rssiMethod(samples);
|
||||
uint16_t r = t.rssiMethod(inputs_sz, samples, test_sz);
|
||||
|
||||
uint16_t expect[test_sz] = {20, 50, 55, 60, 0, 70, 75, 80, 0, 90, 0, 100, 200};
|
||||
uint16_t expect[test_sz] = {20, 50, 55, 60, 0, 70, 75, 80, 0, 90, 0, 100, 110};
|
||||
|
||||
TEST_ASSERT_EQUAL_INT16(20, r);
|
||||
TEST_ASSERT_EQUAL_INT16_ARRAY(expect, samples, test_sz);
|
||||
|
||||
Reference in New Issue
Block a user