summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Wragg <dpw@lshift.net>2010-05-30 23:31:40 +0100
committerDavid Wragg <dpw@lshift.net>2010-05-30 23:31:40 +0100
commit66a0a987914626fc0ea86067a0ea1dd7a2bebdd2 (patch)
tree0e400acdd2e7f35ed47b94d51308b142e82dbeac /tests
parent7e8fbea4c9212774c101e33218d26a0dc992dc03 (diff)
downloadrabbitmq-c-github-ask-66a0a987914626fc0ea86067a0ea1dd7a2bebdd2.tar.gz
Make error codes returned by librabbitmq functions opaque
Windows doesn't generally use POSIX error codes, which poses a problem for librabbitmq's approach of using those error codes in its API. So make the librabbitmq error codes opaque: They are still be integers, but client code is not supposed to assume anything about them, except that they can be passed to a new amqp_error_string() function which returns the corresponding error message Internally, the error codes are either taken from a set of librabbitmq-specific values, or correspond to an OS-specific (POSIX or win32) error code, with a simple encoding to indicate which is which.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_tables.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_tables.c b/tests/test_tables.c
index 282aa8f..1a0652a 100644
--- a/tests/test_tables.c
+++ b/tests/test_tables.c
@@ -210,7 +210,8 @@ static void test_table_codec(void) {
int decoding_offset = 0;
result = amqp_decode_table(decoding_bytes, &pool, &decoded, &decoding_offset);
if (result < 0) {
- printf("Table decoding failed: %d (%s)\n", result, strerror(-result));
+ printf("Table decoding failed: %d (%s)\n", result,
+ amqp_error_string(-result));
abort();
}
printf("BBBBBBBBBB\n");
@@ -228,7 +229,8 @@ static void test_table_codec(void) {
result = amqp_encode_table(encoding_result, &table, &offset);
if (result < 0) {
- printf("Table encoding failed: %d (%s)\n", result, strerror(-result));
+ printf("Table encoding failed: %d (%s)\n", result,
+ amqp_error_string(-result));
abort();
}