Microchip® Advanced Software Framework

sam/drivers/cmcc/unit_tests/unit_tests.c File Reference

Unit tests for CMCC driver.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <conf_test.h>

Macros

#define CMCC_BASE   CMCC
 Define CMCC Base. More...
 
#define FIBONACCI_NUM   30
 

Functions

int main (void)
 Run CMCC driver unit tests. More...
 
static uint32_t recfibo (uint32_t n)
 Recursively calculate the nth Fibonacci number. More...
 
static void run_cache_data_hit_test (const struct test_case *test)
 Test Cache Data Hit Counter Mode. More...
 

Variables

volatile bool flag = false
 
struct cmcc_config g_cmcc_cfg
 CMCC configuration. More...
 

#define CMCC_BASE   CMCC

Define CMCC Base.

Referenced by main(), and run_cache_data_hit_test().

#define FIBONACCI_NUM   30

Referenced by run_cache_data_hit_test().

static uint32_t recfibo ( uint32_t  n)
static

Recursively calculate the nth Fibonacci number.

Parameters
nIndicates which (positive) Fibonacci number to compute.
Returns
The nth Fibonacci number.

Referenced by run_cache_data_hit_test().

static void run_cache_data_hit_test ( const struct test_case test)
static

Test Cache Data Hit Counter Mode.

Parameters
Null.

References CMCC_BASE, cmcc_get_monitor_cnt(), FIBONACCI_NUM, flag, recfibo(), and test_assert_true.

Referenced by main().

struct cmcc_config g_cmcc_cfg

CMCC configuration.

Referenced by main().