mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #2157 from LudwigOrtmann/unittests-lib
tests/unittests: merge lib-ringbuffer into core
This commit is contained in:
commit
536c910980
@ -22,7 +22,7 @@
|
||||
#include "ringbuffer.h"
|
||||
#include "mutex.h"
|
||||
|
||||
#include "tests-lib.h"
|
||||
#include "tests-core.h"
|
||||
|
||||
/* (ITERATIONS * (BUF_SIZE + 1)) needs to be <= 127! Otherwise `char` overflows. */
|
||||
#define ITERATIONS 15
|
||||
@ -106,7 +106,7 @@ static void *run_get(void *arg)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void tests_lib_ringbuffer(void)
|
||||
static void tests_core_ringbuffer(void)
|
||||
{
|
||||
pid_add = sched_active_pid;
|
||||
pid_get = thread_create(stack_get, sizeof (stack_get),
|
||||
@ -115,10 +115,10 @@ static void tests_lib_ringbuffer(void)
|
||||
run_add();
|
||||
}
|
||||
|
||||
Test *tests_lib_ringbuffer_tests(void)
|
||||
Test *tests_core_ringbuffer_tests(void)
|
||||
{
|
||||
EMB_UNIT_TESTFIXTURES(fixtures) {
|
||||
new_TestFixture(tests_lib_ringbuffer),
|
||||
new_TestFixture(tests_core_ringbuffer),
|
||||
};
|
||||
|
||||
EMB_UNIT_TESTCALLER(ringbuffer_tests, NULL, NULL, fixtures);
|
@ -17,4 +17,5 @@ void tests_core(void)
|
||||
TESTS_RUN(tests_core_lifo_tests());
|
||||
TESTS_RUN(tests_core_priority_queue_tests());
|
||||
TESTS_RUN(tests_core_byteorder_tests());
|
||||
TESTS_RUN(tests_core_ringbuffer_tests());
|
||||
}
|
||||
|
@ -78,6 +78,13 @@ Test *tests_core_priority_queue_tests(void);
|
||||
*/
|
||||
Test *tests_core_byteorder_tests(void);
|
||||
|
||||
/**
|
||||
* @brief Generates tests for ringbuffer.h
|
||||
*
|
||||
* @return embUnit tests if successful, NULL if not.
|
||||
*/
|
||||
Test *tests_core_ringbuffer_tests(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1 +0,0 @@
|
||||
include $(RIOTBASE)/Makefile.base
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 René Kijewski
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
#include "tests-lib.h"
|
||||
|
||||
void tests_lib(void)
|
||||
{
|
||||
TESTS_RUN(tests_lib_ringbuffer_tests());
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 René Kijewski
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup unittests
|
||||
* @{
|
||||
*
|
||||
* @file tests-lib.h
|
||||
* @brief Unittests for the ``lib`` sysmodule
|
||||
*
|
||||
* @author René Kijewski <rene.kijewski@fu-berlin.de>
|
||||
*/
|
||||
#ifndef __TESTS_CORE_H_
|
||||
#define __TESTS_CORE_H_
|
||||
|
||||
#include "../unittests.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The entry point of this test suite.
|
||||
*/
|
||||
void tests_lib(void);
|
||||
|
||||
/**
|
||||
* @brief Generates tests ringbuffer.h
|
||||
*
|
||||
* @return embUnit tests if successful, NULL if not.
|
||||
*/
|
||||
Test *tests_lib_ringbuffer_tests(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TESTS_CORE_H_ */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user