STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_h3lis100dl.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dev_h3lis100dl.h"
#include "fake_regs.h"
Include dependency graph for test_h3lis100dl.c:

Go to the source code of this file.

Macros

#define CHECK(c)

Functions

static void healthy (fake_regs_t *f)
static void test_init_writes_the_datasheet_configuration (void)
static void test_wrong_identity_is_refused_before_any_write (void)
static void test_read_back_mismatch_fails (void)
static void test_bus_error_is_reported (void)
static void test_read_takes_x_y_z_from_29_2b_2d (void)
static void test_read_without_ms_bit_would_read_x_three_times (void)
int main (void)

Macro Definition Documentation

◆ CHECK

#define CHECK ( c)
Value:
do { \
if (!(c)) { \
fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, #c); \
exit(1); \
} \
} while (0)

Definition at line 8 of file test_h3lis100dl.c.

Referenced by test_bus_error_is_reported(), test_init_writes_the_datasheet_configuration(), test_read_back_mismatch_fails(), test_read_takes_x_y_z_from_29_2b_2d(), test_read_without_ms_bit_would_read_x_three_times(), and test_wrong_identity_is_refused_before_any_write().

Function Documentation

◆ healthy()

◆ main()

◆ test_bus_error_is_reported()

void test_bus_error_is_reported ( void )
static

Definition at line 53 of file test_h3lis100dl.c.

References CHECK, DEV_ERR_BUS, fake_regs_t::fail_after, fake_regs_bus(), h3lis_init(), and healthy().

Referenced by main().

◆ test_init_writes_the_datasheet_configuration()

void test_init_writes_the_datasheet_configuration ( void )
static

◆ test_read_back_mismatch_fails()

void test_read_back_mismatch_fails ( void )
static

Definition at line 45 of file test_h3lis100dl.c.

References CHECK, DEV_ERR_VERIFY, fake_regs_bus(), h3lis_init(), healthy(), and fake_regs_t::stuck.

Referenced by main().

◆ test_read_takes_x_y_z_from_29_2b_2d()

void test_read_takes_x_y_z_from_29_2b_2d ( void )
static

◆ test_read_without_ms_bit_would_read_x_three_times()

void test_read_without_ms_bit_would_read_x_three_times ( void )
static

Definition at line 78 of file test_h3lis100dl.c.

References h3lis_sample_t::accel, CHECK, DEV_OK, fake_regs_bus(), h3lis_read(), healthy(), and fake_regs_t::regs.

Referenced by main().

◆ test_wrong_identity_is_refused_before_any_write()

void test_wrong_identity_is_refused_before_any_write ( void )
static

Definition at line 36 of file test_h3lis100dl.c.

References CHECK, DEV_ERR_ID, fake_regs_bus(), h3lis_init(), healthy(), fake_regs_t::regs, and fake_regs_t::writes.

Referenced by main().