r39087 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39086‎ | r39087 | r39088 >
Date:20:48, 10 August 2008
Author:river
Status:old
Tags:
Comment:
fix tests on linux/gcc 4.3
Modified paths:
  • /trunk/extensions/AbuseFilter/parser_native/maketest.cpp (modified) (history)
  • /trunk/extensions/AbuseFilter/parser_native/runtests.sh (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/parser_native/maketest.cpp
@@ -14,6 +14,7 @@
1515 * Usage: maketest <filter> [VAR=value] [VAR=value...]
1616 */
1717
 18+#include <cstring>
1819 #include <iostream>
1920
2021 #include <boost/format.hpp>
@@ -28,14 +29,14 @@
2930 return 1;
3031 }
3132
32 - std::cout.write(argv[1], strlen(argv[1]));
 33+ std::cout.write(argv[1], std::strlen(argv[1]));
3334 std::cout.write(&zero, 1);
3435
3536 argc -= 2;
3637 argv += 2;
3738
3839 while (argc) {
39 - char *s = strchr(*argv, '=');
 40+ char *s = std::strchr(*argv, '=');
4041 if (s == NULL) {
4142 std::cerr << "error: variable with no value: " << *argv << '\n';
4243 return 1;
@@ -44,7 +45,7 @@
4546 std::cout.write(*argv, s - *argv);
4647 std::cout.write(&zero, 1);
4748 *s++ = '\0';
48 - std::cout.write(s, strlen(s));
 49+ std::cout.write(s, std::strlen(s));
4950 std::cout.write(&zero, 1);
5051
5152 argc--;
Index: trunk/extensions/AbuseFilter/parser_native/runtests.sh
@@ -5,9 +5,9 @@
66 ntotal=0
77
88 for test in *.t; do
9 - echo "$test \c"
 9+ printf "%-20s " "$test"
1010 filter=$(head -1 $test)
11 - vars=$(tail +2 $test)
 11+ vars=$(tail -n +2 $test)
1212 expect=$(cat ${test%.t}.r)
1313 result=$(../maketest "$filter" $vars | (cd ..; ./af_parser))
1414 if [ "$expect" = "$result" ]; then

Status & tagging log