From: Arjen Baart Date: Wed, 25 Sep 2019 04:16:39 +0000 (+0200) Subject: Added test fir now() X-Git-Tag: v0.2~4 X-Git-Url: http://www.andromeda.nl/gitweb/?a=commitdiff_plain;h=a865642d3ee31bc19fbd8468accdd5fa34946695;p=ACL.git Added test fir now() --- diff --git a/ChangeLog b/ChangeLog index 86dec94..ead7104 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,8 @@ -Aug 29, 2019 - Release 0.3 +Aug 29, 2019 - Release 0.2 ============================ - Implemented hour class - -Jun 22, 2019 - Release 0.2 -============================ - - - Added date class + - Implemented date class May 30, 2019 - Release 0.1 ============================ diff --git a/configure.ac b/configure.ac index 5657a2b..3c53ac7 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([libACL], [0.3], [arjen@androemda.nl]) +AC_INIT([libACL], [0.2], [arjen@androemda.nl]) AM_INIT_AUTOMAKE([-Wall foreign]) AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_FILES([Makefile src/Makefile test/Makefile doc/Makefile]) diff --git a/doc/date.xml b/doc/date.xml index 50a9579..6c983ff 100644 --- a/doc/date.xml +++ b/doc/date.xml @@ -52,7 +52,7 @@ For this date object to be a proper calendar date, the month must be between - + @@ -62,7 +62,7 @@ For this date object to be a proper calendar date, the month must be between - + Parse string s and extract a day, month and year if the string contains an actual date. @@ -106,11 +106,11 @@ The relational operators are defined with obvious meanings:
Attributes - + - + - +
diff --git a/test/Makefile.am b/test/Makefile.am index ef02d0f..aeeb56e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,10 +1,10 @@ -TESTS = $(check_PROGRAMS) date_today check_output +TESTS = $(check_PROGRAMS) date_today hour_now check_output AM_CPPFLAGS = -I../src LDADD = ../src/.libs/libACL.la check_PROGRAMS = string_assign string_basics string_compare string_cat string_substring string_regex \ date_assign date_parse date_compare date_arithmetic date_attributes date_check_today \ - hour_assign hour_parse hour_compare hour_arithmetic + hour_assign hour_parse hour_compare hour_arithmetic hour_check_now string_assign_SOURCES = string_assign.cpp string_basics_SOURCES = string_basics.cpp @@ -27,3 +27,6 @@ hour_assign_SOURCES = hour_assign.cpp hour_parse_SOURCES = hour_parse.cpp hour_compare_SOURCES = hour_compare.cpp hour_arithmetic_SOURCES = hour_arithmetic.cpp +hour_check_now_SOURCES = hour_check_now.cpp + +hour_now : hour_check_now diff --git a/test/date_check_today.cpp b/test/date_check_today.cpp index 5d0d9e0..b47d397 100644 --- a/test/date_check_today.cpp +++ b/test/date_check_today.cpp @@ -1,7 +1,7 @@ /******************************************************* * Unit test for the date class * - * test contrustor and assignment of Sting objects + * test if the today() function returns the system date ****************************************************** * */ diff --git a/test/hour_check_now.cpp b/test/hour_check_now.cpp new file mode 100644 index 0000000..e0cb6ba --- /dev/null +++ b/test/hour_check_now.cpp @@ -0,0 +1,27 @@ +/******************************************************* + * Unit test for the hour class + * + * test if the now() function returns the system date + ****************************************************** + * + */ + +#include "date.h" +#include + +int main(int argc, char *argv[]) +{ + hour d0; + + if (argc == 2) + { + String system_date(argv[1]); + hour d1(system_date); + + d0 = now(); + assert(d0 == d1); + } + + return 0; +} + diff --git a/test/hour_now b/test/hour_now new file mode 100755 index 0000000..f7a7246 --- /dev/null +++ b/test/hour_now @@ -0,0 +1,7 @@ +#!/bin/bash + +STATUS=0 + +TODAY=`date` +./hour_check_now "$TODAY" +exit $?