From de82cb0da4b8fa5b3d56c457438d2568c67ab1b1 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 12 Oct 2021 13:48:39 +0000 Subject: Add TEST_COMPARE_STRING_WIDE to support/check.h I'd like to be able to test narrow and wide string interfaces, with the narrow string tests using TEST_COMPARE_STRING and the wide string tests using something analogous (possibly generated using macros from a common test template for both the narrow and wide string tests where appropriate). Add such a TEST_COMPARE_STRING_WIDE, along with functions support_quote_blob_wide and support_test_compare_string_wide that it builds on. Those functions are built using macros from common templates shared by the narrow and wide string implementations, though I didn't do that for the tests of test functions. In support_quote_blob_wide, I chose to use the \x{} delimited escape sequence syntax proposed for C2X in N2785, rather than e.g. trying to generate the end of a string and the start of a new string when ambiguity would result from undelimited \x (when the next character after such an escape sequence is valid hex) or forcing an escape sequence to be used for the next character in the case of such ambiguity. Tested for x86_64. --- support/Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'support/Makefile') diff --git a/support/Makefile b/support/Makefile index fd27c84..7f03950 100644 --- a/support/Makefile +++ b/support/Makefile @@ -71,6 +71,7 @@ libsupport-routines = \ support_openpty \ support_paths \ support_quote_blob \ + support_quote_blob_wide \ support_quote_string \ support_record_failure \ support_run_diff \ @@ -84,6 +85,7 @@ libsupport-routines = \ support_test_compare_blob \ support_test_compare_failure \ support_test_compare_string \ + support_test_compare_string_wide \ support_test_main \ support_test_verify_impl \ support_wait_for_thread_exit \ @@ -270,11 +272,13 @@ tests = \ tst-support-open-dev-null-range \ tst-support-process_state \ tst-support_quote_blob \ + tst-support_quote_blob_wide \ tst-support_quote_string \ tst-support_record_failure \ tst-test_compare \ tst-test_compare_blob \ tst-test_compare_string \ + tst-test_compare_string_wide \ tst-timespec \ tst-xreadlink \ tst-xsigstack \ -- cgit v1.1