Unicode normalization test broken output

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Unicode normalization test broken output
Date: 2019-12-09 11:05:30
Message-ID: 6a7a8516-7d11-8fbd-0e8b-eadb4f0679eb@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I was playing with the Unicode normalization test in
src/common/unicode/. I think there is something wrong with how the test
program reports failures. For example, if I manually edit the
norm_test_table.h to make a failure, like

- { 74, { 0x00A8, 0 }, { 0x0020, 0x0308, 0 } },
+ { 74, { 0x00A8, 0 }, { 0x0020, 0x0309, 0 } },

then the output from the test is

FAILURE (NormalizationTest.txt line 74):
input: 00
expected: 0003
got 0003

which doesn't make sense.

There appear to be several off-by-more-than-one errors in norm_test.c
print_wchar_str(). Attached is a patch to fix this (and make the output
a bit prettier). Result afterwards:

FAILURE (NormalizationTest.txt line 74):
input: U+00A8
expected: U+0020 U+0309
got: U+0020 U+0308

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Fix-output-of-Unicode-normalization-test.patch text/plain 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2019-12-09 12:02:14 Re: [Proposal] Level4 Warnings show many shadow vars
Previous Message Ranier Vilela 2019-12-09 11:02:27 RE: [Proposal] Level4 Warnings show many shadow vars