Last active
August 29, 2015 14:26
-
-
Save miri64/b246a473811791384bcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.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. | |
*/ | |
/** | |
* @ingroup tests | |
* @{ | |
* | |
* @file | |
* @brief timex_to_str test application | |
* | |
* @author Martine Lenders <mlenders@inf.fu-berlin.de> | |
* | |
* @} | |
*/ | |
#include <stdio.h> | |
#include "timex.h" | |
int main(void) | |
{ | |
timex_t t = { 0, 0 }; | |
char t_str[TIMEX_MAX_STR_LEN]; | |
puts(timex_to_str(t, t_str)); | |
t.seconds = 1; | |
puts(timex_to_str(t, t_str)); | |
t.seconds = 9; | |
t.microseconds = 2640288149; /* should be 2649.288149 */ | |
puts(timex_to_str(t, t_str)); | |
t.seconds = 1689940699; | |
t.microseconds = 4361; /* should be 2649.288149 */ | |
puts(timex_to_str(t, t_str)); | |
t.seconds = UINT32_MAX; | |
t.microseconds = 999999; /* should be .999999 */ | |
puts(timex_to_str(t, t_str)); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APPLICATION = timex_to_str | |
BOARD ?= native | |
RIOTBASE ?= $(CURDIR)/../RIOT | |
QUIET ?= 1 | |
USEMODULE += timex | |
CFLAGS += -DLOG_LEVEL=LOG_NONE | |
include $(RIOTBASE)/Makefile.include |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment