aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vespalib/src/tests/guard/guard_test.cpp6
-rw-r--r--vespalib/src/tests/testapp-debug/testapp-debug.cpp8
-rw-r--r--vespalib/src/tests/testapp-state/testapp-state.cpp8
-rw-r--r--vespalib/src/vespa/vespalib/net/selector.cpp4
4 files changed, 18 insertions, 8 deletions
diff --git a/vespalib/src/tests/guard/guard_test.cpp b/vespalib/src/tests/guard/guard_test.cpp
index a9d5d5f894c..9889f466edb 100644
--- a/vespalib/src/tests/guard/guard_test.cpp
+++ b/vespalib/src/tests/guard/guard_test.cpp
@@ -35,7 +35,8 @@ Test::testFilePointer()
FilePointer file(fopen("filept.txt", "r"));
EXPECT_TRUE(file.valid());
char tmp[128];
- fgets(tmp, sizeof(tmp), file);
+ char *fgetsres = fgets(tmp, sizeof(tmp), file);
+ ASSERT_EQUAL(tmp, fgetsres);
EXPECT_TRUE(strcmp(tmp, "Hello") == 0);
}
{
@@ -57,7 +58,8 @@ Test::testFilePointer()
file.reset(fopen("filept.txt", "r"));
EXPECT_TRUE(file.valid());
char tmp[128];
- fgets(tmp, sizeof(tmp), file.fp());
+ char *fgetsres = fgets(tmp, sizeof(tmp), file.fp());
+ ASSERT_EQUAL(tmp, fgetsres);
EXPECT_TRUE(strcmp(tmp, "World") == 0);
FILE *ref = file.fp();
diff --git a/vespalib/src/tests/testapp-debug/testapp-debug.cpp b/vespalib/src/tests/testapp-debug/testapp-debug.cpp
index 8c75a104cd8..0083200ac51 100644
--- a/vespalib/src/tests/testapp-debug/testapp-debug.cpp
+++ b/vespalib/src/tests/testapp-debug/testapp-debug.cpp
@@ -4,8 +4,12 @@
using namespace vespalib;
TEST_MAIN() {
- system("./vespalib_debug_test_app");
- system("diff lhs.out rhs.out > diff.out");
+ int status = system("./vespalib_debug_test_app");
+ ASSERT_FALSE(WIFSIGNALED(status));
+ EXPECT_NOT_EQUAL(0, WEXITSTATUS(status));
+ status = system("diff lhs.out rhs.out > diff.out");
+ ASSERT_FALSE(WIFSIGNALED(status));
+ EXPECT_NOT_EQUAL(0, WEXITSTATUS(status));
std::string diff_cmd("diff diff.out ");
diff --git a/vespalib/src/tests/testapp-state/testapp-state.cpp b/vespalib/src/tests/testapp-state/testapp-state.cpp
index eda67a15d60..683476a5525 100644
--- a/vespalib/src/tests/testapp-state/testapp-state.cpp
+++ b/vespalib/src/tests/testapp-state/testapp-state.cpp
@@ -4,8 +4,12 @@
using namespace vespalib;
TEST_MAIN() {
- system("./vespalib_state_test_app > out.txt 2>&1 out.txt");
- system("cat out.txt | grep STATE | sed 's/([^)].*\\//(/' > actual.txt");
+ int status = system("./vespalib_state_test_app > out.txt 2>&1 out.txt");
+ ASSERT_FALSE(WIFSIGNALED(status));
+ EXPECT_NOT_EQUAL(0, WEXITSTATUS(status));
+ status = system("cat out.txt | grep STATE | sed 's/([^)].*\\//(/' > actual.txt");
+ ASSERT_FALSE(WIFSIGNALED(status));
+ EXPECT_EQUAL(0, WEXITSTATUS(status));
std::string diff_cmd("diff -u actual.txt ");
diff_cmd += TEST_PATH("expect.txt");
diff --git a/vespalib/src/vespa/vespalib/net/selector.cpp b/vespalib/src/vespa/vespalib/net/selector.cpp
index 6fad2e71444..e59638b6144 100644
--- a/vespalib/src/vespa/vespalib/net/selector.cpp
+++ b/vespalib/src/vespa/vespalib/net/selector.cpp
@@ -45,14 +45,14 @@ void
WakeupPipe::write_token()
{
char token = 'T';
- write(_pipe[1], &token, 1);
+ [[maybe_unused]] ssize_t res = write(_pipe[1], &token, 1);
}
void
WakeupPipe::read_tokens()
{
char token_trash[128];
- read(_pipe[0], token_trash, sizeof(token_trash));
+ [[maybe_unused]] ssize_t res = read(_pipe[0], token_trash, sizeof(token_trash));
}
//-----------------------------------------------------------------------------