mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/unittests: add basic zptr test
This commit is contained in:
parent
5dc32b14cc
commit
f3874edd14
1
tests/unittests/tests-zptr/Makefile
Normal file
1
tests/unittests/tests-zptr/Makefile
Normal file
@ -0,0 +1 @@
|
||||
include $(RIOTBASE)/Makefile.base
|
1
tests/unittests/tests-zptr/Makefile.include
Normal file
1
tests/unittests/tests-zptr/Makefile.include
Normal file
@ -0,0 +1 @@
|
||||
USEMODULE += zptr
|
44
tests/unittests/tests-zptr/tests-zptr.c
Normal file
44
tests/unittests/tests-zptr/tests-zptr.c
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
|
||||
#include "zptr.h"
|
||||
#include "tests-zptr.h"
|
||||
|
||||
static void test_zptr_basic(void)
|
||||
{
|
||||
uint32_t val;
|
||||
TEST_ASSERT(&val == zptrd(zptrc(&val)));
|
||||
}
|
||||
|
||||
Test *tests_zptr_tests(void)
|
||||
{
|
||||
EMB_UNIT_TESTFIXTURES(fixtures) {
|
||||
new_TestFixture(test_zptr_basic),
|
||||
};
|
||||
|
||||
EMB_UNIT_TESTCALLER(zptr_tests, NULL, NULL, fixtures);
|
||||
|
||||
return (Test *)&zptr_tests;
|
||||
}
|
||||
|
||||
void tests_zptr(void)
|
||||
{
|
||||
TESTS_RUN(tests_zptr_tests());
|
||||
}
|
||||
/** @} */
|
37
tests/unittests/tests-zptr/tests-zptr.h
Normal file
37
tests/unittests/tests-zptr/tests-zptr.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
|
||||
*
|
||||
* 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
|
||||
* @brief Unittests for the ``zptr`` module
|
||||
*
|
||||
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
||||
*/
|
||||
#ifndef TESTS_ZPTR_H
|
||||
#define TESTS_ZPTR_H
|
||||
|
||||
#include "embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The entry point of this test suite.
|
||||
*/
|
||||
void tests_zptr(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TESTS_ZPTR_H */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user