bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error, verror: Add tests


From: Bruno Haible
Subject: error, verror: Add tests
Date: Thu, 12 Jan 2023 12:42:01 +0100

In a testdir on Android 11, I am seeing these test failures:

FAIL: test-xstrtoimax.sh
========================

--- exp 2023-01-10 14:13:27.438800298 +0100
+++ out 2023-01-10 14:13:27.388800678 +0100
@@ -1,9 +1,9 @@
 1->1 ()
 -1->-1 ()
 1k->1024 ()
-invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
-X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
-invalid X argument 'x'
-invalid suffix in X argument '9x'
+ invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
+ X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
+ invalid X argument 'x'
+ invalid suffix in X argument '9x'
 010->8 ()
 MiB->1048576 ()
FAIL test-xstrtoimax.sh (exit status: 1)

FAIL: test-xstrtol.sh
=====================

--- expected    2023-01-10 14:13:28.422126166 +0100
+++ out 2023-01-10 14:13:28.378793162 +0100
@@ -1,20 +1,20 @@
 1->1 ()
 -1->-1 ()
 1k->1024 ()
-invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
-X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
-invalid X argument 'x'
-invalid suffix in X argument '9x'
+ invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
+ X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
+ invalid X argument 'x'
+ invalid suffix in X argument '9x'
 010->8 ()
 MiB->1048576 ()
-invalid suffix in X argument '1bB'
+ invalid suffix in X argument '1bB'
 1->1 ()
-invalid X argument '-1'
+ invalid X argument '-1'
 1k->1024 ()
-invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
-X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
-invalid X argument 'x'
-invalid suffix in X argument '9x'
+ invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
+ X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
+ invalid X argument 'x'
+ invalid suffix in X argument '9x'
 010->8 ()
 MiB->1048576 ()
-invalid suffix in X argument '1bB'
+ invalid suffix in X argument '1bB'
FAIL test-xstrtol.sh (exit status: 1)

FAIL: test-xstrtoll.sh
======================

--- expected    2023-01-10 14:13:29.378785569 +0100
+++ out 2023-01-10 14:13:29.328785949 +0100
@@ -1,18 +1,18 @@
 1->1 ()
 -1->-1 ()
 1k->1024 ()
-invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
-X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
-invalid X argument 'x'
-invalid suffix in X argument '9x'
+ invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
+ X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
+ invalid X argument 'x'
+ invalid suffix in X argument '9x'
 010->8 ()
 MiB->1048576 ()
 1->1 ()
-invalid X argument '-1'
+ invalid X argument '-1'
 1k->1024 ()
-invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
-X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
-invalid X argument 'x'
-invalid suffix in X argument '9x'
+ invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
+ X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
+ invalid X argument 'x'
+ invalid suffix in X argument '9x'
 010->8 ()
 MiB->1048576 ()
FAIL test-xstrtoll.sh (exit status: 1)

FAIL: test-xstrtoumax.sh
========================

--- exp 2023-01-10 14:13:30.125446567 +0100
+++ out 2023-01-10 14:13:30.082113563 +0100
@@ -1,9 +1,9 @@
 1->1 ()
-invalid X argument '-1'
+ invalid X argument '-1'
 1k->1024 ()
-invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
-X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
-invalid X argument 'x'
-invalid suffix in X argument '9x'
+ invalid suffix in X argument 
'99999999999999999999999999999999999999999999999999999999999999999999h'
+ X argument 
'99999999999999999999999999999999999999999999999999999999999999999999' too large
+ invalid X argument 'x'
+ invalid suffix in X argument '9x'
 010->8 ()
 MiB->1048576 ()
FAIL test-xstrtoumax.sh (exit status: 1)


Looking at the code of xstrtol-error, this seems to indicate that the error()
functions inserts an additional space where it shouldn't.

So, as a first step, let me add a unit test for the 'error' module. And, while
at it, also one for the 'verror' module.


2023-01-12  Bruno Haible  <bruno@clisp.org>

        verror: Add tests.
        * tests/test-verror.sh: New file, based on tests/test-error.sh.
        * tests/test-verror.c: New file, based on tests/test-error.c.
        * modules/verror-tests: New file.

2023-01-12  Bruno Haible  <bruno@clisp.org>

        error: Add tests.
        * tests/test-error.sh: New file.
        * tests/test-error.c: New file.
        * modules/error-tests: New file.

Attachment: 0001-error-Add-tests.patch
Description: Text Data

Attachment: 0002-verror-Add-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]