STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_main.cpp File Reference
#include <string.h>
#include "radio.h"
#include "radio_fake.h"
#include "unity.h"
Include dependency graph for test_main.cpp:

Go to the source code of this file.

Functions

void setUp (void)
void tearDown (void)
static void test_probe_ok_when_chip_present (void)
static void test_probe_reports_not_found_when_chip_missing (void)
static void test_receive_with_nothing_waiting_returns_no_data (void)
static void test_receive_returns_injected_packet_with_its_length (void)
static void test_receive_is_first_in_first_out (void)
static void test_receive_keeps_working_after_queue_wraps (void)
static void test_inject_refuses_when_queue_full (void)
static void test_inject_refuses_empty_packet (void)
static void test_receive_drops_packet_bigger_than_buffer (void)
static void test_send_is_visible_to_the_test (void)
static void test_reset_forgets_what_was_sent (void)
static void test_send_counts_each_packet (void)
static void test_send_fails_when_chip_missing (void)
static void test_send_gives_the_failure_the_test_asks_for (void)
int main (void)

Function Documentation

◆ main()

◆ setUp()

void setUp ( void )

Definition at line 12 of file test_main.cpp.

References radio_link::fake::reset().

◆ tearDown()

void tearDown ( void )

Definition at line 15 of file test_main.cpp.

◆ test_inject_refuses_empty_packet()

void test_inject_refuses_empty_packet ( void )
static

Definition at line 94 of file test_main.cpp.

References radio_link::fake::inject(), radio_link::NoData, and radio_link::radio_receive().

Referenced by main().

◆ test_inject_refuses_when_queue_full()

void test_inject_refuses_when_queue_full ( void )
static

◆ test_probe_ok_when_chip_present()

void test_probe_ok_when_chip_present ( void )
static

Definition at line 18 of file test_main.cpp.

References radio_link::Ok, radio_link::radio_probe(), and radio_link::fake::reset().

Referenced by main().

◆ test_probe_reports_not_found_when_chip_missing()

void test_probe_reports_not_found_when_chip_missing ( void )
static

Definition at line 23 of file test_main.cpp.

References radio_link::ErrNotFound, radio_link::radio_probe(), and radio_link::fake::reset().

Referenced by main().

◆ test_receive_drops_packet_bigger_than_buffer()

void test_receive_drops_packet_bigger_than_buffer ( void )
static

◆ test_receive_is_first_in_first_out()

void test_receive_is_first_in_first_out ( void )
static

Definition at line 47 of file test_main.cpp.

References a, b, radio_link::fake::inject(), radio_link::Ok, and radio_link::radio_receive().

Referenced by main().

◆ test_receive_keeps_working_after_queue_wraps()

void test_receive_keeps_working_after_queue_wraps ( void )
static

◆ test_receive_returns_injected_packet_with_its_length()

void test_receive_returns_injected_packet_with_its_length ( void )
static

◆ test_receive_with_nothing_waiting_returns_no_data()

void test_receive_with_nothing_waiting_returns_no_data ( void )
static

Definition at line 28 of file test_main.cpp.

References radio_link::NoData, and radio_link::radio_receive().

Referenced by main().

◆ test_reset_forgets_what_was_sent()

void test_reset_forgets_what_was_sent ( void )
static

◆ test_send_counts_each_packet()

void test_send_counts_each_packet ( void )
static

◆ test_send_fails_when_chip_missing()

void test_send_fails_when_chip_missing ( void )
static

◆ test_send_gives_the_failure_the_test_asks_for()

void test_send_gives_the_failure_the_test_asks_for ( void )
static

◆ test_send_is_visible_to_the_test()

void test_send_is_visible_to_the_test ( void )
static

Definition at line 114 of file test_main.cpp.

References back(), radio_link::fake::last_sent(), radio_link::Ok, and radio_link::radio_send().

Referenced by main().