343 Commits

Author SHA1 Message Date
Owen Rudge
cbad9bcec9 Add from_time_t test for 64-bit time_t 2022-03-01 11:15:22 -05:00
James E. King III
0be5d92c90 refresh ci, codecov, readme
- align to current boost-ci practice
- deal with VERY slow test runner in microsec_time_clock test
- disable sanitize tests - too many issues in boost serialization right now
- omit unit tests from coverage
2022-02-11 21:14:28 -05:00
Jeff Garland
8011fdf0bc ptime from iso error string error with date only (#192)
* fix #189 for autolink -- driveby change to remove gcc2.95 support

* fix #187 date-only case to avoid string exception, beef up error case test
2021-05-02 08:57:36 -07:00
Jeff Garland
30795441e4 add constexpr tests to date, ptime, constrained_value (#162) 2020-07-09 08:06:58 -07:00
Andrey Semashev
d335a54e9f Add missing includes and fix special_value_from_string definition (#144)
* Added a test generator for whether all public headers are self-contained.

The generator creates a compile test for every public header, unless
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS environment variable
is set to 1.

* Only enable self-contained header tests on a few jobs.

There is no point in performing self-contained header tests on every compiler
configuration, so running them only on some saves CI time.

* Make public headers self-contained.

This commit:

- Adds missing includes.
- Adjusts gregorian namespace qualification in a few places to use use
  equivalent symbols from date_time and not have to include gregorian
  headers.
- Converts tabs to spaces and trims trailing spaces.

This makes the self-contained header tests pass on Linux.

* Move special_value_from_string definition to parsers.hpp.

This resolves different attributes applied to the function definition
in parsers.hpp and greg_month.hpp. The function is now inline and defined
in parsers.hpp.

Also, the commit converts tabs to spaces and trims trailing spaces.

Fixes https://github.com/boostorg/date_time/issues/143.

* Convert tabs to spaces and trim trailing spaces.
2020-04-05 07:27:27 -07:00
Jeff Garland
bbac2178ed add stub library for backward compatibility (#137)
* remove legacy to_simple_string and prefer streaming in test code

* driveby fix to clean up self-assign compiler warnings in test code

* driveby fix to clean up unused variable compiler warnings in test code

* another update for issue #123 (constexpr) to allow time_duration constexpr to work

* final updates to make date_time free of library - issue #134

* make a stub library for backward compatibility of libs that link date_time library
2020-03-15 21:03:59 -07:00
Jeff Garland
d8c7a59ed9 pull request to make date-time all inline (#135)
* remove legacy to_simple_string and prefer streaming in test code

* driveby fix to clean up self-assign compiler warnings in test code

* driveby fix to clean up unused variable compiler warnings in test code

* another update for issue #123 (constexpr) to allow time_duration constexpr to work

* final updates to make date_time free of library - issue #134
2020-03-15 04:27:39 -07:00
Jeff Garland
139f44776d date time misc cleanup (#131)
* remove superflous HAS_MICROSECOND and HAS_MILLISECOND macros

* remove pre 1_33 facet detection for dead compilers
2020-03-12 18:36:13 -07:00
Gawain Bolton
1a95e81043 Add time_duration helper functions: (#113)
1. is_positive()
  - Return boolean value to indicate whether or not time duration is
    positive.
2. is_zero()
  - Return boolean value to indicate whether or not time duration is
    zero.
3. abs()
  - Return a time_duration which is the absolute value of time
    duration.

Added documentation for these helper functions and improved existing
documentation to indicate constness, return values or static
functions.
2019-11-01 04:08:45 -07:00
James E. King III
c0b71da135 Update CI Scripts 2019-10-14 16:42:18 -04:00
cclienti
3cc68a4642 Synchronize each miscrosec test to the next second (#109)
* Synchronize each miscrosec test to the next second

The aim is to avoid false positives in test_microsec when the seconds,
minutes or hours change during time read between the second_clock and
the microsec_clock.

* Improved readability of the microcec_time_clock test
2019-10-08 07:17:01 -07:00
James E. King III
dae0fa1b47 quiet unused variable warnings in compile_fail tests 2018-01-28 10:04:59 -05:00
James E. King III
3f092da750 trac-13159, trac-12630: fix maximum year to 9999 2018-01-24 09:44:04 -05:00
James E. King III
8b92513a94 trac-1078: given to_iso_string can print special values, make from_iso_string read them 2018-01-22 15:49:25 -05:00
James E. King III
d8a1ed32fb add codecov.io, cppcheck, ubsan, and coverity scan support; refactor travis to use jobs 2018-01-21 20:14:06 -05:00
James E. King III
e0da18162a trac-9882: fix gcc -Wshadow errors and warnings enabled by trac-3606 2018-01-17 09:22:22 -05:00
James E. King III
f35bbbe906 trac-3606: fix remaining msvc /W4 complaints (msvc-10.0 and up) 2018-01-17 09:22:22 -05:00
James E. King III
18b6ca8160 trac-11142: fix boost::date_time::period_parser::delimiter_strings and add a unit test for it
also added project declarations to jamfiles, added a top level jamfile, and fixed the xmldoc jamfile
also fixed a silent failure y2038 issue in localtime handling and fixed a timezone database parse issue
2018-01-16 12:46:45 -05:00
James E. King III
e78132c031 issue-56: fix 32/64 bit test issue with previous fix 2018-01-07 11:23:14 -05:00
Edward Diener
3c794d085a Catch any runtime exception which could occur when calling c_time:local_time. 2017-12-31 21:18:41 -05:00
Edward Diener
00ab3d7226 Merge pull request #64 from jeking3/trac-11168
trac-11168: special_values handling in time duration helpers
2017-12-31 00:42:27 -05:00
Edward Diener
2bf11e74a2 Merge pull request #59 from jeking3/trac-12910
trac-12910: allow %j without a year specifier - uses epoch year
2017-12-30 23:32:49 -05:00
Edward Diener
2e4a3010f0 Merge pull request #58 from jeking3/issue-56
issue-56: fix binary serialization compatibility problem with time_duration
2017-12-30 16:26:42 -05:00
James E. King III
de171954fe Fix serialization problem with time_duration
This fixes #56
2017-12-29 23:38:44 -05:00
James E. King III
f9f2aaf521 trac-11168: ensure special values are not automatically translated to integral types in the hours, minutes, seconds, and fractional seconds time duration helpers 2017-12-28 14:44:01 -05:00
James E. King III
e87b7120ac trac-12910: allow %j without a year specifier - uses epoch year 2017-12-26 12:02:14 -05:00
James E. King, III
b3b6ddd5ba trac-13194: fix time input facet processing for %e 2017-12-22 08:02:24 -05:00
Peter Dimov
53da52ee05 Bracket archive use to fix xml serialization test failures 2017-11-13 21:44:04 +02:00
Peter Dimov
2434bc8f4d Pass input files properly via the run rule 2017-11-13 21:20:41 +02:00
Andrey Semashev
266e6cc8e1 Silence MSVC warnings about unused exception variables in tests. 2017-08-28 20:06:24 +03:00
Andrey Semashev
b3a1f75376 Silence MSVC warning about possible integer truncation. 2017-08-28 20:05:46 +03:00
Andrey Semashev
6b3452954e Silenced clang warning about unused variable. 2017-08-11 16:10:00 +03:00
Andrey Semashev
587a677ebc Limit the warning-related pragmas to MSVC, clang and gcc specifically. 2017-08-11 16:04:16 +03:00
Andrey Semashev
d3986cf902 Silence warnings about signed/unsigned mismatch in comparison operators. 2017-08-10 19:08:58 +03:00
Andrey Semashev
82f61328b2 Fixed "invalid character" warnings from clang.
The character was indeed not a valid UTF-8 character. Presumably, it is a
valid character in some national encoding, but Unicode is ubiquitous nowdays
and the compiler is not able to know the encoding anyway. Thus the commit
converts the character to a hex-escaped UTF-8 representation of character
U+00FC ('ü').
2017-08-10 19:01:45 +03:00
Andrey Semashev
d972d0cd69 Expand range of values in years overflow test to ensure the whole documented range is allowed. 2017-08-08 19:32:08 +03:00
Andrey Semashev
6af6215e9e Fixed integer overflow when subtracting many years to a gregorian date.
Also added a testcase to detect the overflow.
2017-08-08 17:42:51 +03:00
Andrey Semashev
729af79cc5 Fixed integer overflow when adding many years to a gregorian date.
Also added a testcase to detect the overflow.
2017-08-08 17:23:46 +03:00
David Callu
ee4ceddc52 add posix_time::from_iso_extended_string 2016-05-26 21:15:13 +02:00
Andrey Semashev
ae536816ee Restored to_time_t() function removed by commit 6636f49f13. 2014-05-31 20:46:36 +04:00
K. Noel Belcourt
6636f49f13 Merge branch 'master' into develop 2014-05-09 20:36:03 -06:00
Daniel James
6f82742918 Add some automatic checks to testc_local_adjustor.
Not full tests, but enough to catch the error fixed in
344c0dceb4.
2014-04-07 22:30:38 +01:00
Marshall Clow
ef81faff5f Added test for bug #5041 - %y in single digit year
Ahmed Charles: Tests pass with MSVC 2013.
2014-03-13 15:08:38 -07:00
Marshall Clow
057e0aaf64 Merge DateTime bug fix to Release; Fixes #9216
[SVN r86322]
2013-10-15 15:22:02 +00:00
Marshall Clow
072b4e1b61 Fix several 'iterating past the end' bugs in Boost.DateTime; Refs #9216
[SVN r86230]
2013-10-10 15:43:31 +00:00
Marshall Clow
5126bfbc0a Added missing call 'to_time_t' (and tests)
[SVN r84284]
2013-05-14 21:22:01 +00:00
Andrey Semashev
6bbd9f50bc Merged changes from trunk. Fixes #3471.
[SVN r80940]
2012-10-10 19:05:03 +00:00
Andrey Semashev
98bbc0b95c Fixed compilation with MinGW.
[SVN r80890]
2012-10-06 17:54:32 +00:00
Andrey Semashev
29c0f85c14 Fixed compilation with MSVC.
[SVN r80889]
2012-10-06 17:46:27 +00:00
Andrey Semashev
11974f29b2 Refs #3471. Precompute the duration conversion coefficient to avoid integer overflow. Added a test for integer overflow in the subsecond duration constructor.
[SVN r80887]
2012-10-06 17:34:06 +00:00