mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpgscm: Improve test of low-level functions.
* tests/gpgscm/t-child.c: Print large amounts of data. * tests/gpgscm/t-child.scm: Test that this works. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
dff2660598
commit
11eac7eb2f
2 changed files with 34 additions and 1 deletions
|
@ -22,6 +22,8 @@
|
|||
(define (qualify executable)
|
||||
(string-append executable (getenv "EXEEXT")))
|
||||
|
||||
(define child (qualify "t-child"))
|
||||
|
||||
(assert (= 0 (call `(,(qualify "t-child") "return0"))))
|
||||
(assert (= 1 (call `(,(qualify "t-child") "return1"))))
|
||||
(assert (= 77 (call `(,(qualify "t-child") "return77"))))
|
||||
|
@ -51,6 +53,16 @@
|
|||
(assert (string=? "" (:stdout r)))
|
||||
(assert (string=? "hello" (:stderr r))))
|
||||
|
||||
(let ((r (call-with-io `(,(qualify "t-child") "stdout4096") "")))
|
||||
(assert (= 0 (:retcode r)))
|
||||
(assert (= 4096 (string-length (:stdout r))))
|
||||
(assert (string=? "" (:stderr r))))
|
||||
|
||||
(let ((r (call-with-io `(,(qualify "t-child") "stdout8192") "")))
|
||||
(assert (= 0 (:retcode r)))
|
||||
(assert (= 8192 (string-length (:stdout r))))
|
||||
(assert (string=? "" (:stderr r))))
|
||||
|
||||
(let ((r (call-with-io `(,(qualify "t-child") "cat") "hellohello")))
|
||||
(assert (= 0 (:retcode r)))
|
||||
(assert (string=? "hellohello" (:stdout r)))
|
||||
|
@ -90,4 +102,17 @@
|
|||
(wait-processes '("child0" "child1") (list pid0 pid1) #t))))
|
||||
(echo " world.")
|
||||
|
||||
(tr:do
|
||||
(tr:pipe-do
|
||||
(pipe:spawn `(,child stdout4096))
|
||||
(pipe:spawn `(,child cat)))
|
||||
(tr:call-with-content (lambda (c)
|
||||
(assert (= 4096 (length c))))))
|
||||
(tr:do
|
||||
(tr:pipe-do
|
||||
(pipe:spawn `(,child stdout8192))
|
||||
(pipe:spawn `(,child cat)))
|
||||
(tr:call-with-content (lambda (c)
|
||||
(assert (= 8192 (length c))))))
|
||||
|
||||
(echo "All good.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue