]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add rev(1) check
authorSami Kerola <kerolasa@iki.fi>
Sat, 19 Jan 2013 00:08:51 +0000 (00:08 +0000)
committerKarel Zak <kzak@redhat.com>
Thu, 24 Jan 2013 15:49:25 +0000 (16:49 +0100)
Fairly lenghty input line tries to ensure realloc segment in code is hit
at least once.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests/commands.sh
tests/expected/misc/rev [new file with mode: 0644]
tests/ts/misc/rev [new file with mode: 0755]

index 3672095480f6214c0d0c4df508da7d173d61977e..f1643a685f07addc06e7ee57172837eccf9998e5 100644 (file)
@@ -45,6 +45,7 @@ TS_CMD_IPCS=${TS_CMD_IPCS:-"$top_builddir/ipcs"}
 TS_CMD_COL=${TS_CMD_COL:-"$top_builddir/col"}
 TS_CMD_COLUMN=${TS_CMD_COLUMN:-"$top_builddir/column"}
 TS_CMD_COLRM=${TS_CMD_COLRM:-"$top_builddir/colrm"}
+TS_CMD_REV=${TS_CMD_REV:-"$top_builddir/rev"}
 
 TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/namei"}
 TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/look"}
diff --git a/tests/expected/misc/rev b/tests/expected/misc/rev
new file mode 100644 (file)
index 0000000..4847902
--- /dev/null
@@ -0,0 +1 @@
+ z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a z y x w v u t s r q p o n m l k j i h g f e d c b a!
diff --git a/tests/ts/misc/rev b/tests/ts/misc/rev
new file mode 100755 (executable)
index 0000000..d1fba16
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="rev"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+for I in {0..512}; do printf "%s " {a..z}; done |
+       $TS_CMD_REV > $TS_OUTPUT 2>&1
+
+ts_finalize