diff options
author | Sven Gothel <[email protected]> | 2021-11-02 16:11:33 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-11-02 16:11:33 +0100 |
commit | 02ccb9426604763d1ed69c62c5d6af8e72192c1b (patch) | |
tree | d1052f385c36b1b657b9c9cd8f64fa5c08f3d7b8 /test | |
parent | 68ed3fb1192c141cc343bcf998cc7a0c40be88b5 (diff) |
ringbuffer: Add notion of operating threading mode for more efficancyv0.7.0
Add notion of operating threading mode for more efficancy:
- One producer-thread and one consumer-thread (default)
- Multiple producer-threads and multiple consumer-threads
Diffstat (limited to 'test')
-rw-r--r-- | test/test_lfringbuffer11.cpp | 16 | ||||
-rw-r--r-- | test/test_lfringbuffer12.cpp | 16 | ||||
-rw-r--r-- | test/test_lfringbuffer13.cpp | 16 |
3 files changed, 48 insertions, 0 deletions
diff --git a/test/test_lfringbuffer11.cpp b/test/test_lfringbuffer11.cpp index 694112a..7a7a709 100644 --- a/test/test_lfringbuffer11.cpp +++ b/test/test_lfringbuffer11.cpp @@ -132,6 +132,8 @@ class TestRingbuffer11 { INFO_STR("\n\ntest01a_Read1Write1\n"); jau::nsize_t capacity = 100; TrivialTypeRingbuffer rb = createEmpty(capacity); + + fprintf(stderr, "test01a_Read1Write1: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -148,6 +150,8 @@ class TestRingbuffer11 { INFO_STR("\n\ntest01b_Read1Write1_Range\n"); jau::nsize_t capacity = 100; TrivialTypeRingbuffer rb = createEmpty(capacity); + + fprintf(stderr, "test01b_Read1Write1_Range: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -164,6 +168,9 @@ class TestRingbuffer11 { INFO_STR("\n\ntest02a_Read4Write1\n"); jau::nsize_t capacity = 400; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test02a_Read4Write1: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -186,6 +193,9 @@ class TestRingbuffer11 { INFO_STR("\n\ntest02b_Read4Write1_Range\n"); jau::nsize_t capacity = 400; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test02b_Read4Write1_Range: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -208,6 +218,9 @@ class TestRingbuffer11 { INFO_STR("\n\ntest03a_Read8Write2\n"); jau::nsize_t capacity = 800; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test03a_Read8Write2: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -242,6 +255,9 @@ class TestRingbuffer11 { INFO_STR("\n\ntest03b_Read8Write2_Range\n"); jau::nsize_t capacity = 800; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test03b_Read8Write2_Range: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); diff --git a/test/test_lfringbuffer12.cpp b/test/test_lfringbuffer12.cpp index 75a2985..6404fda 100644 --- a/test/test_lfringbuffer12.cpp +++ b/test/test_lfringbuffer12.cpp @@ -151,6 +151,8 @@ class TestRingbuffer12 { INFO_STR("\n\ntest01a_Read1Write1\n"); jau::nsize_t capacity = 100; TrivialTypeRingbuffer rb = createEmpty(capacity); + + fprintf(stderr, "test01a_Read1Write1: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -167,6 +169,8 @@ class TestRingbuffer12 { INFO_STR("\n\ntest01b_Read1Write1_Range\n"); jau::nsize_t capacity = 100; TrivialTypeRingbuffer rb = createEmpty(capacity); + + fprintf(stderr, "test01b_Read1Write1_Range: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -183,6 +187,9 @@ class TestRingbuffer12 { INFO_STR("\n\ntest02a_Read4Write1\n"); jau::nsize_t capacity = 400; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test02a_Read4Write1: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -205,6 +212,9 @@ class TestRingbuffer12 { INFO_STR("\n\ntest02b_Read4Write1_Range\n"); jau::nsize_t capacity = 400; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test02b_Read4Write1_Range: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -227,6 +237,9 @@ class TestRingbuffer12 { INFO_STR("\n\ntest03a_Read8Write2\n"); jau::nsize_t capacity = 800; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test03a_Read8Write2: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); @@ -261,6 +274,9 @@ class TestRingbuffer12 { INFO_STR("\n\ntest03b_Read8Write2_Range\n"); jau::nsize_t capacity = 800; TrivialTypeRingbuffer rb = createEmpty(capacity); + rb.setMultiPCEnabled(true); + + fprintf(stderr, "test03b_Read8Write2_Range: %s\n", rb.get_info().c_str()); REQUIRE_MSG("empty size "+rb.toString(), 0 == rb.size()); REQUIRE_MSG("empty "+rb.toString(), rb.isEmpty()); diff --git a/test/test_lfringbuffer13.cpp b/test/test_lfringbuffer13.cpp index 1588bfc..c64c276 100644 --- a/test/test_lfringbuffer13.cpp +++ b/test/test_lfringbuffer13.cpp @@ -145,6 +145,8 @@ class TestRingbuffer13 { INFO_STR("\n\ntest01a_Read1Write1\n"); jau::nsize_t capacity = 100; std::shared_ptr<SharedTypeRingbuffer> rb = createEmpty(capacity); + + fprintf(stderr, "test01a_Read1Write1: %s\n", rb->get_info().c_str()); REQUIRE_MSG("empty size "+rb->toString(), 0 == rb->size()); REQUIRE_MSG("empty "+rb->toString(), rb->isEmpty()); @@ -161,6 +163,8 @@ class TestRingbuffer13 { INFO_STR("\n\ntest01b_Read1Write1_Range\n"); jau::nsize_t capacity = 100; std::shared_ptr<SharedTypeRingbuffer> rb = createEmpty(capacity); + + fprintf(stderr, "test01b_Read1Write1_Range: %s\n", rb->get_info().c_str()); REQUIRE_MSG("empty size "+rb->toString(), 0 == rb->size()); REQUIRE_MSG("empty "+rb->toString(), rb->isEmpty()); @@ -177,6 +181,9 @@ class TestRingbuffer13 { INFO_STR("\n\ntest02a_Read4Write1\n"); jau::nsize_t capacity = 400; std::shared_ptr<SharedTypeRingbuffer> rb = createEmpty(capacity); + rb->setMultiPCEnabled(true); + + fprintf(stderr, "test02a_Read4Write1: %s\n", rb->get_info().c_str()); REQUIRE_MSG("empty size "+rb->toString(), 0 == rb->size()); REQUIRE_MSG("empty "+rb->toString(), rb->isEmpty()); @@ -199,6 +206,9 @@ class TestRingbuffer13 { INFO_STR("\n\ntest02b_Read4Write1_Range\n"); jau::nsize_t capacity = 400; std::shared_ptr<SharedTypeRingbuffer> rb = createEmpty(capacity); + rb->setMultiPCEnabled(true); + + fprintf(stderr, "test02b_Read4Write1_Range: %s\n", rb->get_info().c_str()); REQUIRE_MSG("empty size "+rb->toString(), 0 == rb->size()); REQUIRE_MSG("empty "+rb->toString(), rb->isEmpty()); @@ -221,6 +231,9 @@ class TestRingbuffer13 { INFO_STR("\n\ntest03a_Read8Write2\n"); jau::nsize_t capacity = 800; std::shared_ptr<SharedTypeRingbuffer> rb = createEmpty(capacity); + rb->setMultiPCEnabled(true); + + fprintf(stderr, "test03a_Read8Write2: %s\n", rb->get_info().c_str()); REQUIRE_MSG("empty size "+rb->toString(), 0 == rb->size()); REQUIRE_MSG("empty "+rb->toString(), rb->isEmpty()); @@ -255,6 +268,9 @@ class TestRingbuffer13 { INFO_STR("\n\ntest03b_Read8Write2_Range\n"); jau::nsize_t capacity = 800; std::shared_ptr<SharedTypeRingbuffer> rb = createEmpty(capacity); + rb->setMultiPCEnabled(true); + + fprintf(stderr, "test03b_Read8Write2_Range: %s\n", rb->get_info().c_str()); REQUIRE_MSG("empty size "+rb->toString(), 0 == rb->size()); REQUIRE_MSG("empty "+rb->toString(), rb->isEmpty()); |