From 24a573a23d47f0d9b31dba82dcab38a6fdb916ed Mon Sep 17 00:00:00 2001 From: Maytastico Date: Tue, 17 Sep 2024 16:22:15 +0000 Subject: [PATCH] #402-Code-Building-Sara --- blickbox/sara/platformio.ini | 4 ++++ blickbox/sara/src/main.cpp | 6 +++--- blickbox/sara/test/test_battery.cpp | 13 ++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/blickbox/sara/platformio.ini b/blickbox/sara/platformio.ini index c082e5a..2457076 100644 --- a/blickbox/sara/platformio.ini +++ b/blickbox/sara/platformio.ini @@ -26,6 +26,7 @@ selected_tests = * [env:native_selected_unittests] platform = native +check_tool = clangtidy build_flags = -D unity_testing -std=c++11 ; Verwende den C++17 Standard @@ -34,6 +35,9 @@ lib_deps = - SaraLIB - LibStubs test_framework = ${options.test_framework} +check_flags = + clangtidy: --checks=-*,cert-*,clang-analyzer-* --fix + [env:ble] platform = nordicnrf52 diff --git a/blickbox/sara/src/main.cpp b/blickbox/sara/src/main.cpp index 756ef31..c562047 100644 --- a/blickbox/sara/src/main.cpp +++ b/blickbox/sara/src/main.cpp @@ -1,10 +1,10 @@ #include +#include +#include #include #include -#include -#include #include -#include +#include #if defined(NRF52_SERIES) #include diff --git a/blickbox/sara/test/test_battery.cpp b/blickbox/sara/test/test_battery.cpp index 5084bdb..e8c68a1 100644 --- a/blickbox/sara/test/test_battery.cpp +++ b/blickbox/sara/test/test_battery.cpp @@ -1,16 +1,19 @@ -#include +#include #include +#include using namespace sara_battery; -#define BATTERY_PIN 6 +enum { +BATTERY_PIN = 6 +}; SaraBatteryManager battery_manager (BATTERY_PIN); -void setUp(void) { +void setUp() { } -void tearDown(void) { +void tearDown() { } void test_correct_ADC_units(){ @@ -30,7 +33,7 @@ void test_battery_map_voltage() { TEST_ASSERT_EQUAL_INT8(battery_percent, -5); } -int main( int argc, char **argv) { +auto main( int /*argc*/, char ** /*argv*/) -> int { UNITY_BEGIN(); RUN_TEST(test_correct_ADC_units);