1
0
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:
Kaspar Schleiser 2017-09-05 18:54:43 +02:00
parent 5dc32b14cc
commit f3874edd14
4 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1 @@
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1 @@
USEMODULE += zptr

View 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());
}
/** @} */

View 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 */
/** @} */