2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-12 12:02:54 +00:00
Commit Graph

8 Commits

Author SHA1 Message Date
Nat Goodspeed
b51d78877c Test that bounded_channel(n, n) throws an exception.
Given the documented behavior of bounded_channel(hwm, lwm), it follows that
bounded_channel(n, n) is invalid.

If the number of items in the channel == hwm, a push will block.

But if the number of items in the channel <= lwm, a push will succeed without
blocking.

Therefore, setting hwm == lwm results in a contradiction.
2015-08-15 11:12:34 -04:00
Nat Goodspeed
3e95946350 Add tests for bounded_channel::lower_bound().
We intend to document that bounded_channel(hwm) is equivalent to
bounded_channel(hwm, (hwm-1)). That may or may not simplify the code, but it
certainly simplifies the reader's mental model of the relationship between the
two constructors.

However, that assertion requires that for bounded_channel(hwm), lower_bound()
in fact return (hwm-1). Test for that.

Also use BOOST_CHECK_EQUAL(a, b) instead of BOOST_CHECK(a == b) where
applicable, since the former is more informative when the test fails.

Sadly, tests on channel_op_status must still use BOOST_CHECK(a == b) --
apparently because channel_op_status, as an enum class, cannot be streamed to
std::ostream?
2015-08-15 10:48:58 -04:00
Oliver Kowalke
7c25c83465 (un)bounded_channel: remove is_empty()/is_closed()/is_full() 2015-08-05 19:59:47 +02:00
Nat Goodspeed
b6f4fc8d42 test_try_push() should call try_push(). 2015-08-05 07:51:49 -04:00
Oliver Kowalke
3b6f736a39 fixes for (un)bounded_channel 2015-08-04 19:30:31 +02:00
Oliver Kowalke
dbfde81013 enhance unit-test for bounded_channel 2015-08-04 17:19:26 +02:00
Oliver Kowalke
ba80101f47 enhance test for bounded_channel
- note implementation of waiting_queue does not preserve order
  therefore unit test for bounded_channel fails
2015-08-03 17:33:04 +02:00
Oliver Kowalke
f456902492 add test for bounded_channel (basics) 2015-08-02 21:17:04 +02:00