summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2013-03-16 16:39:14 +0000
committerPete Batard <pete@akeo.ie>2013-03-16 23:40:30 +0000
commit5ab16a216589d59a4dc85e76b0790ea4196f836a (patch)
treeaa3465d58af2243170306517efbc4c9acfe3cf47 /tests
parente78d37b2acbd804841e8206216a9ffad2112ebb2 (diff)
downloadlibusb-5ab16a216589d59a4dc85e76b0790ea4196f836a.tar.gz
Tests: Suppress Visual Studio 2012 Code Analysis warnings
Diffstat (limited to 'tests')
-rw-r--r--tests/testlib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/testlib.c b/tests/testlib.c
index 77395cb..e69aa39 100644
--- a/tests/testlib.c
+++ b/tests/testlib.c
@@ -48,6 +48,7 @@
#define NULL_PATH "/dev/null"
#endif
#define INVALID_FD -1
+#define IGNORE_RETVAL(expr) do { (void)(expr); } while(0)
/**
* Converts a test result code into a human readable string.
@@ -81,11 +82,11 @@ static void cleanup_test_output(libusbx_testlib_ctx * ctx)
#ifndef DISABLE_STDOUT_REDIRECTION
if (!ctx->verbose) {
if (ctx->old_stdout != INVALID_FD) {
- dup2(ctx->old_stdout, STDOUT_FILENO);
+ IGNORE_RETVAL(dup2(ctx->old_stdout, STDOUT_FILENO));
ctx->old_stdout = INVALID_FD;
}
if (ctx->old_stderr != INVALID_FD) {
- dup2(ctx->old_stderr, STDERR_FILENO);
+ IGNORE_RETVAL(dup2(ctx->old_stderr, STDERR_FILENO));
ctx->old_stderr = INVALID_FD;
}
if (ctx->null_fd != INVALID_FD) {