test: compile fixes

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2017-07-07 21:43:08 +02:00
parent 35d8f0a0ba
commit a7e885464b
4 changed files with 13 additions and 1 deletions

View File

@ -3,6 +3,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <locale.h>

View File

@ -3,6 +3,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include <stdbool.h>
#include <assert.h>

View File

@ -3,6 +3,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include <stdbool.h>
#include <assert.h>
@ -53,9 +54,17 @@ static void test_parse_date_header(){
setlocale(LC_CTYPE, cfg.locale);
localtime_r(&t, &lt);
if(lt.tm_isdst == 1) dst_fix = 3600;
if(lt.tm_isdst == 1){
printf("DST is on\n");
dst_fix = 3600;
}
else {
printf("DST is off\n");
}
for(i=0; i<sizeof(date_test)/sizeof(struct date_test); i++){
printf("%s parsed=%ld, control=%ld\n", date_test[i].date_str, parse_date_header(date_test[i].date_str), date_test[i].timestamp);
assert(parse_date_header(date_test[i].date_str)-dst_fix == date_test[i].timestamp && "test_parse_date_header()");
}

View File

@ -3,6 +3,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <locale.h>