Commit Graph

23 Commits

Author SHA1 Message Date
Chrissie Caulfield
d01a9e0adf
tests: Remove deprecated check macros (#412)
fail_if() and fail_unless() macros are deprecated in more
recent versions of check and are buggy in 0.15, so replace
them with ck_assert() instead.
2020-07-29 14:06:22 +01:00
Christine Caulfield
5889f1ea46 tests: make qb logging under check always dispose the memory
examples/tests: make qb logging dispose the memory

A.k.a. "be a good example of using this very library".

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2017-09-18 10:30:40 +01:00
Christine Caulfield
afdff97f1a [tests] Fix qb_rb_chunk_peek test so it's consistent with qb_rb_read
Now that the library code is too.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2017-01-31 10:41:29 +00:00
Jan Pokorný
3d6135967a
tests: refactor test case defs using versatile add_tcase macro
This reduces repeated code significantly, and allows for easier
supervision of what's being grouped to the suites + possibly what
timeouts apply.

Note that some artificial test case identifiers (in check_array.c,
check_log.c, check_loop.c, check_rb.c, check_utils.c) got changed
so they now follow 1:1 the test (function) name that is being run
for the case at hand without the "test_" prefix (strict convention).
Exception to this are test_ipc_disp_* tests in check_ipc.c that got,
conversely, changed to test_ipc_dispatch_* to follow the test case
identifiers.
2016-03-01 15:11:38 +01:00
Dejan Latinovic
9a3ef70d29 Fix rb.test to avoid overwriting memory during reading.
In test_ring_buffer1,
if the size of the chunk(90-93) is larger than size of the hdr (16),
it comes to overwriting memory during reading.
2013-12-24 14:25:10 +00:00
Angus Salkeld
c566421df9 rb: cleanup the semaphores
- the way they are selected
- rpl_sem.c the error handling

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 10:39:43 +10:00
Angus Salkeld
2ae58d2472 RB: fix test failure on ppc
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-07 11:37:12 +11:00
Fabio M. Di Nitto
9f5d0aebbb Fix some sparc test failures.
I (Angus) have changed some of Fabio's changes.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-22 13:56:20 +11:00
Angus Salkeld
45fa3b045d TESTS: use new logging API
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 16:05:46 +10:00
Angus Salkeld
0207003da5 RB: don't be so timid on shutdown
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-11-02 23:19:26 +11:00
Angus Salkeld
27d7df8edf TEST: make test ouput more verbose
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-30 20:52:12 +11:00
Angus Salkeld
45c41935b7 RB: return EAGAIN not ENOMEM if no space on the rb.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-12 21:53:53 +11:00
Angus Salkeld
8d3ec80c19 RB: add support for shared user data.
(I need this for flow control)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-12 21:53:53 +11:00
Angus Salkeld
08e5a9004d Add a priority based main loop.
This is to try and get a better balance in the amount
of processing between IPC and totem in corosync.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-12 21:53:52 +11:00
Angus Salkeld
f1f301724b IPC: improve resource cleanup/shutdown
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-06 20:39:23 +11:00
Angus Salkeld
e7de13cd9d IPC: add a basic tx/rx test case.
- cleanup some printf's

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-07 08:56:38 +10:00
Angus Salkeld
d27e50c58a Define new return status policy
Good >= 0 (0 = good, or positive value)
Bad < 0 (-errno)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-06 16:49:15 +10:00
Angus Salkeld
8a6b8d78db IPC: rewrite (simpler API & more structured layout).
- implement using posix message queues
- implement using sys-v message queues
- implement shared memory ringbuffers
- add auth via unix sockets
- add items to the TODO

This is still a bit rough, more work to follow...

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-08-23 12:46:36 +10:00
Angus Salkeld
a6285e6f14 RB: add function qb_rb_chunks_used()
This is to make it easier to to see if there is
a chunk available to be read.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-08-09 16:59:26 +10:00
Angus Salkeld
41c06ef6e6 int -> int32_t
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-22 11:55:09 +10:00
Angus Salkeld
ec9a050a29 rb: make rb_chunk_peek() wait on the sem like chunk_read()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-15 12:56:23 +10:00
Angus Salkeld
0a23eb2be1 Format all files with Lindent
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-10 21:42:08 +10:00
Angus Salkeld
bd2c07f739 Add a ringbuffer based off the one in logsys.
This ringbuffer is usable across processes.
the point is to use this for IPC to provide async
connections from client to server, but with inherient
flow control.

This still needs a bit of clean up, but committing now
for feedback and as it is quite functional.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-10 12:44:27 +10:00