diff options
author | josh.macdonald@gmail.com <josh.macdonald@gmail.com@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2012-08-05 21:02:11 +0000 |
---|---|---|
committer | josh.macdonald@gmail.com <josh.macdonald@gmail.com@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2012-08-05 21:02:11 +0000 |
commit | f1f956b4d86dad153f9cbb8eb87b04052c0fa96c (patch) | |
tree | 077c431ac412256e243b94252ff52e539d691d5f | |
parent | d7a5351fd2aa7fd90641cb5007be60ed3332df33 (diff) |
Build fix for gcc-4.7
-rw-r--r-- | xdelta3/testing/regtest.cc | 9 | ||||
-rw-r--r-- | xdelta3/testing/test.h | 1 | ||||
-rw-r--r-- | xdelta3/xdelta3-test.h | 13 |
3 files changed, 10 insertions, 13 deletions
diff --git a/xdelta3/testing/regtest.cc b/xdelta3/testing/regtest.cc index be6309a..d31f6b5 100644 --- a/xdelta3/testing/regtest.cc +++ b/xdelta3/testing/regtest.cc | |||
@@ -108,10 +108,7 @@ void InMemoryEncodeDecode(const FileSpec &source_file, | |||
108 | ret = xd3_decode_input(&decode_stream); | 108 | ret = xd3_decode_input(&decode_stream); |
109 | msg = decode_stream.msg; | 109 | msg = decode_stream.msg; |
110 | } | 110 | } |
111 | 111 | (void) msg; | |
112 | IF_DEBUG1(XPR(NTR "%s = %s %s\n", encoding ? "E " : " D", | ||
113 | xd3_strerror(ret), | ||
114 | msg == NULL ? "" : msg)); | ||
115 | 112 | ||
116 | switch (ret) { | 113 | switch (ret) { |
117 | case XD3_OUTPUT: | 114 | case XD3_OUTPUT: |
@@ -193,6 +190,10 @@ void InMemoryEncodeDecode(const FileSpec &source_file, | |||
193 | goto process; | 190 | goto process; |
194 | 191 | ||
195 | default: | 192 | default: |
193 | XPR(NTR "%s = %s %s\n", encoding ? "E " : " D", | ||
194 | xd3_strerror(ret), | ||
195 | msg == NULL ? "" : msg); | ||
196 | |||
196 | CHECK_EQ(0, ret); | 197 | CHECK_EQ(0, ret); |
197 | CHECK_EQ(-1, ret); | 198 | CHECK_EQ(-1, ret); |
198 | } | 199 | } |
diff --git a/xdelta3/testing/test.h b/xdelta3/testing/test.h index f7c2ced..d1f1a22 100644 --- a/xdelta3/testing/test.h +++ b/xdelta3/testing/test.h | |||
@@ -5,6 +5,7 @@ extern "C" { | |||
5 | #include "../xdelta3-internal.h" | 5 | #include "../xdelta3-internal.h" |
6 | } | 6 | } |
7 | 7 | ||
8 | #include <unistd.h> | ||
8 | #include <math.h> | 9 | #include <math.h> |
9 | #include <string> | 10 | #include <string> |
10 | 11 | ||
diff --git a/xdelta3/xdelta3-test.h b/xdelta3/xdelta3-test.h index 7464c4f..3c5446b 100644 --- a/xdelta3/xdelta3-test.h +++ b/xdelta3/xdelta3-test.h | |||
@@ -178,7 +178,7 @@ static int do_fail (xd3_stream *stream, const char *buf) | |||
178 | if (! WIFEXITED (ret) || WEXITSTATUS (ret) != 1) | 178 | if (! WIFEXITED (ret) || WEXITSTATUS (ret) != 1) |
179 | { | 179 | { |
180 | stream->msg = "command should have not succeeded"; | 180 | stream->msg = "command should have not succeeded"; |
181 | XPR(NT "command was %s", buf); | 181 | XPR(NT "command was %s\n", buf); |
182 | return XD3_INTERNAL; | 182 | return XD3_INTERNAL; |
183 | } | 183 | } |
184 | return 0; | 184 | return 0; |
@@ -218,15 +218,10 @@ test_random_numbers (xd3_stream *stream, int ignore) | |||
218 | static void | 218 | static void |
219 | test_unlink (char* file) | 219 | test_unlink (char* file) |
220 | { | 220 | { |
221 | char buf[TESTBUFSIZE]; | 221 | int ret; |
222 | while (unlink (file) != 0) | 222 | if ((ret = unlink (file)) != 0 && errno != ENOENT) |
223 | { | 223 | { |
224 | if (errno == ENOENT) | 224 | XPR(NT "unlink %s failed: %s\n", file, strerror(ret)); |
225 | { | ||
226 | break; | ||
227 | } | ||
228 | snprintf_func (buf, sizeof(buf), "rm -f %s", file); | ||
229 | system (buf); | ||
230 | } | 225 | } |
231 | } | 226 | } |
232 | 227 | ||