Split functionality into test code in pure C and helper code in XC

This commit is contained in:
mbanth
2021-05-24 15:47:31 +01:00
parent fbef825a3b
commit eb6d3b0869
3 changed files with 20 additions and 14 deletions

View File

@@ -0,0 +1,12 @@
// Copyright 2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <stddef.h>
#include "xua_unit_tests.h"
#include "xua_hid_report_descriptor.h"
void test_uninitialised_hidGetReportDescriptor()
{
unsigned char* reportDescPtr = hidGetReportDescriptor();
TEST_ASSERT_NULL( reportDescPtr );
}

View File

@@ -1,6 +1,13 @@
// Copyright 2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include "xua_unit_tests.h"
#ifdef __XC__
#include <xs1.h>
#include <platform.h>
#include <xclib.h>
#endif // __XC__
in port p_mclk_in = XS1_PORT_1D;
@@ -19,7 +26,3 @@ void AudioHwInit()
{
; // nothing
}
void test_null(){
TEST_ASSERT_MESSAGE(1, "Success!");
}

View File

@@ -4,15 +4,6 @@
#define XUA_UNIT_TESTS_H_
#include "unity.h"
#ifdef __XC__
#include <xs1.h>
#include <platform.h>
#include <xclib.h>
#include "xua_conf.h"
#endif // __XC__
#endif /* XUA_UNIT_TESTS_H_ */