Code Monkey home page Code Monkey logo

c-dt's People

Contributors

chansen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

c-dt's Issues

Obscure behavior of dt_add_years() and dt_add_quarters().

dt_add_quarters(dt_from_ymd(2018, 12, 2), DT_EXCESS))

returns February 4th of next year as result. I would have expected February 2nd. With dt_add_years() an overflow of one day is detected, if the start date starts in a leap year after February 29th and does not end in a leap year. If only the result year lies in a leap year, the result is undercut by one day. If both the start and finish dates are in a leap year, the result is correct again.

make test failure

System:
Linux 3.0.0-24-generic #40~lucid1-Ubuntu SMP Wed Jul 25 14:03:01 UTC 2012 x86_64 GNU/Linux
gcc: gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3

make all works well.
make test felt . The log is here:

make test
cc -Wall -I. -I.. -c -o t/tap.o t/tap.c
cc -Wall -I. -I.. -c -o t/yd.o t/yd.c
cc -lc t/yd.o dt.o t/tap.o -o t/yd.t
cc -Wall -I. -I.. -c -o t/ymd.o t/ymd.c
cc -lc t/ymd.o dt.o t/tap.o -o t/ymd.t
cc -Wall -I. -I.. -c -o t/ymd_epochs.o t/ymd_epochs.c
cc -lc t/ymd_epochs.o dt.o t/tap.o -o t/ymd_epochs.t
cc -Wall -I. -I.. -c -o t/yqd.o t/yqd.c
cc -lc t/yqd.o dt.o t/tap.o -o t/yqd.t
cc -Wall -I. -I.. -c -o t/ywd.o t/ywd.c
cc -lc t/ywd.o dt.o t/tap.o -o t/ywd.t
cc -Wall -I. -I.. -c -o t/tm.o t/tm.c
cc -lc t/tm.o dt.o t/tap.o -o t/tm.t
cc -Wall -I. -I.. -c -o t/easter_western.o t/easter_western.c
cc -lc t/easter_western.o dt.o t/tap.o -o t/easter_western.t
cc -Wall -I. -I.. -c -o t/easter_orthodox.o t/easter_orthodox.c
cc -lc t/easter_orthodox.o dt.o t/tap.o -o t/easter_orthodox.t
cc -Wall -I. -I.. -c -o t/days_in_year.o t/days_in_year.c
cc -lc t/days_in_year.o dt.o t/tap.o -o t/days_in_year.t
cc -Wall -I. -I.. -c -o t/days_in_month.o t/days_in_month.c
cc -lc t/days_in_month.o dt.o t/tap.o -o t/days_in_month.t
cc -Wall -I. -I.. -c -o t/days_in_quarter.o t/days_in_quarter.c
cc -lc t/days_in_quarter.o dt.o t/tap.o -o t/days_in_quarter.t
cc -Wall -I. -I.. -c -o t/first_day_of_year.o t/first_day_of_year.c
cc -lc t/first_day_of_year.o dt.o t/tap.o -o t/first_day_of_year.t
cc -Wall -I. -I.. -c -o t/first_day_of_quarter.o t/first_day_of_quarter.c
cc -lc t/first_day_of_quarter.o dt.o t/tap.o -o t/first_day_of_quarter.t
cc -Wall -I. -I.. -c -o t/first_day_of_month.o t/first_day_of_month.c
cc -lc t/first_day_of_month.o dt.o t/tap.o -o t/first_day_of_month.t
cc -Wall -I. -I.. -c -o t/first_day_of_week.o t/first_day_of_week.c
cc -lc t/first_day_of_week.o dt.o t/tap.o -o t/first_day_of_week.t
cc -Wall -I. -I.. -c -o t/last_day_of_year.o t/last_day_of_year.c
cc -lc t/last_day_of_year.o dt.o t/tap.o -o t/last_day_of_year.t
cc -Wall -I. -I.. -c -o t/last_day_of_quarter.o t/last_day_of_quarter.c
cc -lc t/last_day_of_quarter.o dt.o t/tap.o -o t/last_day_of_quarter.t
cc -Wall -I. -I.. -c -o t/last_day_of_month.o t/last_day_of_month.c
cc -lc t/last_day_of_month.o dt.o t/tap.o -o t/last_day_of_month.t
cc -Wall -I. -I.. -c -o t/last_day_of_week.o t/last_day_of_week.c
cc -lc t/last_day_of_week.o dt.o t/tap.o -o t/last_day_of_week.t
cc -Wall -I. -I.. -c -o t/next_day_of_week.o t/next_day_of_week.c
cc -lc t/next_day_of_week.o dt.o t/tap.o -o t/next_day_of_week.t
cc -Wall -I. -I.. -c -o t/prev_day_of_week.o t/prev_day_of_week.c
cc -lc t/prev_day_of_week.o dt.o t/tap.o -o t/prev_day_of_week.t
cc -Wall -I. -I.. -c -o t/next_weekday.o t/next_weekday.c
cc -lc t/next_weekday.o dt.o t/tap.o -o t/next_weekday.t
cc -Wall -I. -I.. -c -o t/prev_weekday.o t/prev_weekday.c
cc -lc t/prev_weekday.o dt.o t/tap.o -o t/prev_weekday.t
cc -Wall -I. -I.. -c -o t/nth_day_of_week.o t/nth_day_of_week.c
cc -lc t/nth_day_of_week.o dt.o t/tap.o -o t/nth_day_of_week.t
cc -Wall -I. -I.. -c -o t/add_months.o t/add_months.c
cc -lc t/add_months.o dt.o t/tap.o -o t/add_months.t
t/yd.t .................... Unrecognized character \x7F in column 1 at t/yd.t line 1.
t/yd.t .................... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/ymd.t ................... Unrecognized character \x7F in column 1 at t/ymd.t line 1.
t/ymd.t ................... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/ymd_epochs.t ............ Unrecognized character \x7F in column 1 at t/ymd_epochs.t line 1.
t/ymd_epochs.t ............ Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/yqd.t ................... Unrecognized character \x7F in column 1 at t/yqd.t line 1.
t/yqd.t ................... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/ywd.t ................... Unrecognized character \x7F in column 1 at t/ywd.t line 1.
t/ywd.t ................... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/tm.t .................... Unrecognized character \x7F in column 1 at t/tm.t line 1.
t/tm.t .................... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/easter_western.t ........ Unrecognized character \x7F in column 1 at t/easter_western.t line 1.
t/easter_western.t ........ Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/easter_orthodox.t ....... Unrecognized character \x7F in column 1 at t/easter_orthodox.t line 1.
t/easter_orthodox.t ....... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/days_in_year.t .......... Unrecognized character \x7F in column 1 at t/days_in_year.t line 1.
t/days_in_year.t .......... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/days_in_month.t ......... Unrecognized character \x7F in column 1 at t/days_in_month.t line 1.
t/days_in_month.t ......... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/days_in_quarter.t ....... Unrecognized character \x7F in column 1 at t/days_in_quarter.t line 1.
t/days_in_quarter.t ....... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/first_day_of_year.t ..... Unrecognized character \x7F in column 1 at t/first_day_of_year.t line 1.
t/first_day_of_year.t ..... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/first_day_of_quarter.t .. Unrecognized character \x7F in column 1 at t/first_day_of_quarter.t line 1.
t/first_day_of_quarter.t .. Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/first_day_of_month.t .... Unrecognized character \x7F in column 1 at t/first_day_of_month.t line 1.
t/first_day_of_month.t .... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/first_day_of_week.t ..... Unrecognized character \x7F in column 1 at t/first_day_of_week.t line 1.
t/first_day_of_week.t ..... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/last_day_of_year.t ...... Unrecognized character \x7F in column 1 at t/last_day_of_year.t line 1.
t/last_day_of_year.t ...... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/last_day_of_quarter.t ... Unrecognized character \x7F in column 1 at t/last_day_of_quarter.t line 1.
t/last_day_of_quarter.t ... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/last_day_of_month.t ..... Unrecognized character \x7F in column 1 at t/last_day_of_month.t line 1.
t/last_day_of_month.t ..... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/last_day_of_week.t ...... Unrecognized character \x7F in column 1 at t/last_day_of_week.t line 1.
t/last_day_of_week.t ...... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/next_day_of_week.t ...... Unrecognized character \x7F in column 1 at t/next_day_of_week.t line 1.
t/next_day_of_week.t ...... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/prev_day_of_week.t ...... Unrecognized character \x7F in column 1 at t/prev_day_of_week.t line 1.
t/prev_day_of_week.t ...... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/next_weekday.t .......... Unrecognized character \x7F in column 1 at t/next_weekday.t line 1.
t/next_weekday.t .......... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/prev_weekday.t .......... Unrecognized character \x7F in column 1 at t/prev_weekday.t line 1.
t/prev_weekday.t .......... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/nth_day_of_week.t ....... Unrecognized character \x7F in column 1 at t/nth_day_of_week.t line 1.
t/nth_day_of_week.t ....... Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run
t/add_months.t ............ Unrecognized character \x7F in column 1 at t/add_months.t line 1.
t/add_months.t ............ Dubious, test returned 9 (wstat 2304, 0x900)
No subtests run

Test Summary Report

t/yd.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/ymd.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/ymd_epochs.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/yqd.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/ywd.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/tm.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/easter_western.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/easter_orthodox.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/days_in_year.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/days_in_month.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/days_in_quarter.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/first_day_of_year.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/first_day_of_quarter.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/first_day_of_month.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/first_day_of_week.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/last_day_of_year.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/last_day_of_quarter.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/last_day_of_month.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/last_day_of_week.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/next_day_of_week.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/prev_day_of_week.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/next_weekday.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/prev_weekday.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/nth_day_of_week.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
t/add_months.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: No plan found in TAP output
Files=25, Tests=0, 0 wallclock secs ( 0.07 usr + 0.02 sys = 0.09 CPU)
Result: FAIL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.