163 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
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
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
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
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
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
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
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
Daniel James
693c89198f Merge some old datetime changes to release
- [70756] Convert jamfile for examples to boost build v2.
- [79211][79212] Suppress g++4.6 warnings in tests.
- Document NO LIB option. Fixes #6077.


[SVN r80629]
2012-09-22 16:21:43 +00:00
Jeff Garland
97c2acd867 minor updates to suppress g++4.6 warnings
[SVN r79212]
2012-07-01 17:04:48 +00:00
Marshall Clow
0872610990 Merge fixes to release; Fixes #5126
[SVN r71250]
2011-04-14 15:58:01 +00:00
Marshall Clow
1e00a75273 Applied patch; Refs #5126
[SVN r71190]
2011-04-11 18:09:59 +00:00
Andrey Semashev
2cf2957cd5 Merged changes from trunk (rev. 62450). Fixes #3876.
[SVN r62667]
2010-06-09 16:33:36 +00:00
Andrey Semashev
901cb1fd20 Refs #3876. Made format flags %T and %R to be processed by the library in order to support them on more platforms. Also marked some flags that are known to have similar problems in the docs.
[SVN r62450]
2010-06-05 17:09:37 +00:00
Andrey Semashev
1510fb009d Merged fixes for #287, #1859 and partially #1861. Improved diagnostics in case of test failures.
[SVN r53618]
2009-06-04 08:24:49 +00:00
Andrey Semashev
8e9f05161d Improved diagnostics in case of test failure.
[SVN r53528]
2009-06-01 09:02:43 +00:00
Andrey Semashev
fbab6c1ddf Merged fixes for #2688 and #2698 from trunk.
[SVN r50942]
2009-02-01 11:29:43 +00:00
Andrey Semashev
15c4ebd523 Removed dereferencing of end iterators of strings, which could cause crashes on MSVC. Fixed #2698.
[SVN r50877]
2009-01-29 18:54:17 +00:00
Andrey Semashev
86a65b062a testfrmwk.hpp moved to the tests directory. It was not a part of the library public interface and should not be seen by users.
[SVN r49946]
2008-11-26 21:07:14 +00:00
Andrey Semashev
4a238482e8 testfrmwk.hpp moved to the tests directory. It was not a part of the library public interface and should not be seen by users.
[SVN r49932]
2008-11-25 20:36:52 +00:00
Andrey Semashev
ee9241c634 Merged fixes from trunk: tickets 2521, 2523.
[SVN r49893]
2008-11-23 11:13:35 +00:00
Andrey Semashev
4ea026b835 In FILETIME support functions fixed a possible integer wrapping that would cause to invalid conversion of FILETIME before 1970-01-01 into a DateTime time. In time facet changed the reaction on a too long hours string to an assert rather than truncating the string. Updated docs and tests to reflect these changes.
[SVN r49874]
2008-11-22 12:49:20 +00:00
Andrey Semashev
a2049a59d6 Merged various fixes from trunk.
[SVN r49705]
2008-11-12 19:37:53 +00:00