BIND 10 master, updated. ed9fbd276086a6b494f7fd5b573e23f0e467007a [1704] Fix unused-result warnings in InterprocessSyncFileTest
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jun 4 08:58:59 UTC 2012
The branch, master has been updated
via ed9fbd276086a6b494f7fd5b573e23f0e467007a (commit)
from adca81c006608c1e97b900380ce48834876c2908 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ed9fbd276086a6b494f7fd5b573e23f0e467007a
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jun 4 14:27:42 2012 +0530
[1704] Fix unused-result warnings in InterprocessSyncFileTest
-----------------------------------------------------------------------
Summary of changes:
.../util/tests/interprocess_sync_file_unittest.cc | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/util/tests/interprocess_sync_file_unittest.cc b/src/lib/util/tests/interprocess_sync_file_unittest.cc
index a0b4109..9a1b025 100644
--- a/src/lib/util/tests/interprocess_sync_file_unittest.cc
+++ b/src/lib/util/tests/interprocess_sync_file_unittest.cc
@@ -45,7 +45,8 @@ parentReadLockedState (int fd) {
if (nfds == 1) {
// Read status
- read(fd, &locked, sizeof(locked));
+ ssize_t bytes_read = read(fd, &locked, sizeof(locked));
+ EXPECT_EQ(sizeof(locked), bytes_read);
}
return (locked);
@@ -68,7 +69,7 @@ TEST(InterprocessSyncFileTest, TestLock) {
// done from the same process for the granted range. The lock
// attempt must fail to pass our check.
- pipe(fds);
+ EXPECT_EQ(0, pipe(fds));
if (fork() == 0) {
unsigned char locked = 0;
@@ -85,7 +86,9 @@ TEST(InterprocessSyncFileTest, TestLock) {
EXPECT_TRUE(locker2.isLocked());
}
- write(fds[1], &locked, sizeof(locked));
+ ssize_t bytes_written = write(fds[1], &locked, sizeof(locked));
+ EXPECT_EQ(sizeof(locked), bytes_written);
+
close(fds[1]);
exit(0);
} else {
@@ -130,7 +133,7 @@ TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
int fds[2];
- pipe(fds);
+ EXPECT_EQ(0, pipe(fds));
if (fork() == 0) {
unsigned char locked = 0xff;
@@ -144,7 +147,9 @@ TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
locked = 0;
}
- write(fds[1], &locked, sizeof(locked));
+ ssize_t bytes_written = write(fds[1], &locked, sizeof(locked));
+ EXPECT_EQ(sizeof(locked), bytes_written);
+
close(fds[1]);
exit(0);
} else {
More information about the bind10-changes
mailing list