ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
main.c File Reference

Tests for protobuf sensor functions. More...

#include <libents/proto/sensor.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unity.h>

Go to the source code of this file.

Functions

void setUp (void)
 Setup code that runs at the start of every test.
 
void tearDown (void)
 Tear down code that runs at the end of every test.
 
void TestTranscodeSensorMeasurement (void)
 Encodes then decodes single sensor measurement.
 
void TestTranscodeRepeatedSensorMeasurements (void)
 Encodes then decodes repeated sensor measurements.
 
void TestRepeatedSensorMeasurementsOptimize (void)
 
void TestEncodeUint32Measurement (void)
 
void TestEncodeInt32Measurement (void)
 
void TestEncodeDoubleMeasurement (void)
 
void TestRepeatedSensorResponses (void)
 
void TestCheckSensorResponse (void)
 
void TestRepeatedSensorMeasurementsSize (void)
 
int main (void)
 Entry point for protobuf test.
 

Detailed Description

Tests for protobuf sensor functions.

Author
John Madden jmadd.nosp@m.en17.nosp@m.3@pm..nosp@m.me
Date
2025-12-10

Copyright (c) 2026 jLab, UCSC

Definition in file main.c.

Function Documentation

◆ main()

◆ setUp()

void setUp ( void  )

Setup code that runs at the start of every test.

Definition at line 24 of file main.c.

◆ tearDown()

void tearDown ( void  )

Tear down code that runs at the end of every test.

Definition at line 29 of file main.c.

◆ TestCheckSensorResponse()

void TestCheckSensorResponse ( void  )

Definition at line 281 of file main.c.

References CheckSensorResponse(), SENSOR_FORMAT, SENSOR_OK, and SENSOR_REUPLOAD.

Referenced by main().

◆ TestEncodeDoubleMeasurement()

void TestEncodeDoubleMeasurement ( void  )

Definition at line 225 of file main.c.

References buffer, EncodeDoubleMeasurement(), and SENSOR_OK.

Referenced by main().

◆ TestEncodeInt32Measurement()

void TestEncodeInt32Measurement ( void  )

Definition at line 206 of file main.c.

References buffer, EncodeInt32Measurement(), and SENSOR_OK.

Referenced by main().

◆ TestEncodeUint32Measurement()

void TestEncodeUint32Measurement ( void  )

Definition at line 187 of file main.c.

References buffer, EncodeUint32Measurement(), and SENSOR_OK.

Referenced by main().

◆ TestRepeatedSensorMeasurementsOptimize()

void TestRepeatedSensorMeasurementsOptimize ( void  )

Definition at line 131 of file main.c.

References buffer, DecodeRepeatedSensorMeasurements(), EncodeRepeatedSensorMeasurements(), i, and SENSOR_OK.

Referenced by main().

◆ TestRepeatedSensorMeasurementsSize()

void TestRepeatedSensorMeasurementsSize ( void  )

Definition at line 319 of file main.c.

References i, RepeatedSensorMeasurementsSize(), and SENSOR_OK.

Referenced by main().

◆ TestRepeatedSensorResponses()

void TestRepeatedSensorResponses ( void  )

Definition at line 244 of file main.c.

References buffer, DecodeRepeatedSensorReponses(), EncodeRepeatedSensorResponses(), and SENSOR_OK.

Referenced by main().

◆ TestTranscodeRepeatedSensorMeasurements()

void TestTranscodeRepeatedSensorMeasurements ( void  )

Encodes then decodes repeated sensor measurements.

Definition at line 76 of file main.c.

References buffer, DecodeRepeatedSensorMeasurements(), EncodeRepeatedSensorMeasurements(), i, and SENSOR_OK.

Referenced by main().

◆ TestTranscodeSensorMeasurement()

void TestTranscodeSensorMeasurement ( void  )

Encodes then decodes single sensor measurement.

Definition at line 34 of file main.c.

References buffer, DecodeSensorMeasurement(), EncodeSensorMeasurement(), and SENSOR_OK.

Referenced by main().