]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test1167: catch #defines with extra whitespace
authorViktor Szakats <commit@vsz.me>
Wed, 26 Feb 2025 11:13:43 +0000 (12:13 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 26 Feb 2025 13:01:40 +0000 (14:01 +0100)
Before this patch, it missed this in `curl/curl.h`:
```c
#  define __has_declspec_attribute(x) 0
```
After this patch:
```
test 1167...[Verify curl prefix of public symbols in header files]
/usr/bin/perl -I. -I.  returned 1, when expecting 0
 1167: exit FAILED
== Contents of files in the log/14/ dir after test 1167
=== Start of file server.cmd
 Testnum 1167
=== End of file server.cmd
=== Start of file stdout1167
 Bad symbols in public header files:
   __has_declspec_attribute(x)
=== End of file stdout1167
FAIL 1167: 'Verify curl prefix of public symbols in header files' source analysis
TESTFAIL: These test cases failed: 1167
```

Ref: #16491
Closes #16496

tests/test1167.pl

index 82c05d61aac359463d52709ca49e4789f876c1cb..d180411a145934610c096a7f922c30c7ae8332b5 100755 (executable)
@@ -124,7 +124,7 @@ sub scanheader {
     open H, "<$f";
     while(<H>) {
         my ($line, $linenum) = ($_, $.);
-        if (/^#define +([^ \n]*)/) {
+        if (/^ *# *define +([^ \n]*)/) {
             if($verbose) {
                 print "Source: $f\n";
                 print "Symbol: $1\n";