Skip to content
Snippets Groups Projects
Unverified Commit 14619889 authored by Zoe Pfister's avatar Zoe Pfister :speech_balloon:
Browse files

WIP: replace pack solution of Message transfer to JSON solution using ArduinoJson.

parent cf45fde7
No related branches found
No related tags found
6 merge requests!39Merge Develop into Main,!19development into master,!17Inital Host, initial Client,!10merge serial comm and sd write into espnow,!8merge sensor_readout into develop,!7move to c++17, change message building, refactored SensorInformation and MeasurementData
#include "TestMessage.hpp"
void test_on_data_recv()
{
Message message = Message{};
TEST_ASSERT_EQUAL(0, message.getData().amountData);
}
void test_new_message_filled()
{
Message message = Message{};
message.add_data(1.1, 0);
message.add_data(1.2, 1);
message.add_data(1.3, 2);
float expectedValuesArray[] = {1.1, 1.2, 1.3};
int expectedIdentifiersArray[] = {0, 1, 2};
TEST_ASSERT_EQUAL(3, message.getData().amountData);
TEST_ASSERT_EQUAL_FLOAT_ARRAY(expectedValuesArray, message.getData().values, 3);
TEST_ASSERT_EQUAL_INT_ARRAY(expectedIdentifiersArray, message.getData().identifiers, 3);
}
\ No newline at end of file
#pragma once
#include <Arduino.h>
#include <ESPNow.hpp>
#include <unity.h>
void test_on_data_recv();
void test_new_message_filled();
\ No newline at end of file
#include "TestESPNow.hpp" #include "TestESPNow.hpp"
#include "TestMessage.hpp"
#include <Arduino.h> #include <Arduino.h>
#include <unity.h> #include <unity.h>
#include "TestClientDataPackage.hpp"
void setup() void setup()
{ {
...@@ -9,8 +9,7 @@ void setup() ...@@ -9,8 +9,7 @@ void setup()
UNITY_BEGIN(); UNITY_BEGIN();
RUN_TEST(test_on_data_recv_valid_config); RUN_TEST(test_on_data_recv_valid_config);
RUN_TEST(test_on_data_recv); RUN_TEST(test_export_to_json);
RUN_TEST(test_new_message_filled);
UNITY_END(); UNITY_END();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment