Coverage Report

Created: 2021-08-28 18:14

D:\git\skunkworks\herald-for-cpp\herald-tests\errorcontactlog-tests.cpp
Line
Count
Source
1
//  Copyright 2021 Herald Project Contributors
2
//  SPDX-License-Identifier: Apache-2.0
3
//
4
5
#include "test-templates.h"
6
7
#include "catch.hpp"
8
9
#include <string>
10
11
#include "herald/herald.h"
12
13
1
TEST_CASE("errorcontactlogger-output-dbg", "[errorcontactlogger][output]") {
14
1
  SECTION("errorcontactlogger-output-dbg") {
15
1
    DummyLoggingSink dls;
16
1
    DummyBluetoothStateManager dbsm;
17
1
    herald::DefaultPlatformType dpt;
18
1
    herald::Context ctx(dpt,dls,dbsm); // default context include
19
1
    
20
1
    // Create contact logger
21
1
    herald::data::ConcretePayloadDataFormatter pdf;
22
1
    herald::data::ErrorStreamContactLogger contacts(ctx, pdf);
23
1
24
1
    // test each method to check for output
25
1
    // didDetect
26
1
    contacts.sensor(
27
1
      herald::datatype::SensorType::BLE,
28
1
      herald::datatype::TargetIdentifier(
29
1
        herald::datatype::Data(std::byte(0x09),6)
30
1
      )
31
1
    );
32
1
    // TODO figure out why this test doesn't work on Windoze
33
1
    //  - Seems to be compiling out the HLOGGER, HLOGGERINIT, HERR calls
34
1
    //  - Was due to SHARED LIBRARIES on Windows - need to add HERALD_LOG_LEVEL to
35
1
    //    TOP LEVEL CMakeLists.txt, not just herald-tests project.
36
1
37
1
    REQUIRE(dls.value.size() > 0);
38
1
  }
39
1
}