From fd11470897ea356e5870280e4ab38a18dc83b48f Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 13 May 2015 17:00:41 -0700 Subject: ART: Fix unused return-value in test Check the return value of system() call. Change-Id: I1f5f9621f6a39029b9df5b0d4ab0e230ba6c79a3 --- compiler/utils/assembler_thumb_test.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'compiler/utils/assembler_thumb_test.cc') diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index 772fa9aa4b..773862710d 100644 --- a/compiler/utils/assembler_thumb_test.cc +++ b/compiler/utils/assembler_thumb_test.cc @@ -15,9 +15,11 @@ */ #include +#include #include -#include #include +#include +#include #include "gtest/gtest.h" #include "utils/arm/assembler_thumb2.h" @@ -105,12 +107,14 @@ void dump(std::vector& code, const char* testname) { // Assemble the .S snprintf(cmd, sizeof(cmd), "%sas %s -o %s.o", toolsdir.c_str(), filename, filename); - system(cmd); + int cmd_result = system(cmd); + ASSERT_EQ(cmd_result, 0) << strerror(errno); // Remove the $d symbols to prevent the disassembler dumping the instructions // as .word snprintf(cmd, sizeof(cmd), "%sobjcopy -N '$d' %s.o %s.oo", toolsdir.c_str(), filename, filename); - system(cmd); + int cmd_result2 = system(cmd); + ASSERT_EQ(cmd_result2, 0) << strerror(errno); // Disassemble. @@ -119,7 +123,8 @@ void dump(std::vector& code, const char* testname) { if (kPrintResults) { // Print the results only, don't check. This is used to generate new output for inserting // into the .inc file. - system(cmd); + int cmd_result3 = system(cmd); + ASSERT_EQ(cmd_result3, 0) << strerror(errno); } else { // Check the results match the appropriate results in the .inc file. FILE *fp = popen(cmd, "r"); -- cgit v1.2.3-59-g8ed1b