]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libtests: stop building the sames source multiple times
authorViktor Szakats <commit@vsz.me>
Wed, 11 Jun 2025 14:28:42 +0000 (16:28 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 11 Jun 2025 17:05:47 +0000 (19:05 +0200)
After this patch there is no more double/multiple compile of the same
libtest source under a different libtest ID. Each libtest is compiled
once, and changing behavior at runtime based on test ID.

- drop recently added physical clones for two prevously multi-compiled
  tests:
  - merge lib587 into lib554 again, branch at runtime.
  - merge lib645 into lib643 again, branch at runtime.

- replace existing dynamic branching to use `testnum` instead of
  a manually rolled `testno` based on an extra command-line argument.
  lib1571, lib1576.

- mk-bundle.pl: stop defining `LIB*` macros. No longer used.

- libtests: drop all `LIB*_C` guards.

- Make these tests branch at runtime, stop building copies:
  - lib585, based on lib500
  - lib565, based on lib510
  - lib529, based on lib525
  - lib527, lib532, based on lib526
  - lib545, based on lib544
  - lib548, based on lib547
  - lib696, based on lib556
  - lib584, based on lib589
  - lib1539, based on lib1514
  - lib1543, based on lib1518
  - lib1917, based on lib1916
  - lib1946, based on lib1940
  - lib671, 672, 673, based on lib670

Follow-up to 02dd471bbf8e04fc595ad0f28c965c278ffcefd0 #17591
Follow-up to 6897aeb10561b55c6659866fc0518dd67422f267 #17468

Closes #17598

51 files changed:
tests/data/test1539
tests/data/test1543
tests/data/test1571
tests/data/test1572
tests/data/test1573
tests/data/test1574
tests/data/test1575
tests/data/test1576
tests/data/test1578
tests/data/test1581
tests/data/test1917
tests/data/test1946
tests/data/test527
tests/data/test529
tests/data/test532
tests/data/test545
tests/data/test548
tests/data/test565
tests/data/test584
tests/data/test585
tests/data/test586
tests/data/test587
tests/data/test595
tests/data/test596
tests/data/test645
tests/data/test671
tests/data/test672
tests/data/test673
tests/data/test696
tests/libtest/Makefile.inc
tests/libtest/lib1514.c
tests/libtest/lib1518.c
tests/libtest/lib1571.c
tests/libtest/lib1576.c
tests/libtest/lib1916.c
tests/libtest/lib1940.c
tests/libtest/lib500.c
tests/libtest/lib510.c
tests/libtest/lib525.c
tests/libtest/lib526.c
tests/libtest/lib544.c
tests/libtest/lib547.c
tests/libtest/lib554.c
tests/libtest/lib555.c
tests/libtest/lib556.c
tests/libtest/lib587.c [deleted file]
tests/libtest/lib589.c
tests/libtest/lib643.c
tests/libtest/lib645.c [deleted file]
tests/libtest/lib670.c
tests/mk-bundle.pl

index 3ef12fe5ee524b3e8b175650d698279764098116..0431ba670b5950e8a103cf5aa7f93785ee602bc1 100644 (file)
@@ -24,7 +24,7 @@ Connection: close
 http
 </server>
 <tool>
-lib%TESTNUMBER
+lib1514
 </tool>
 <name>
 HTTP 1.0 POST with read callback and unknown data size
index be7ede20923d5d20129f7413d63f08411bd95e83..3aefe57ef11ae39d682be5b5ac8adcea2ca1198a 100644 (file)
@@ -38,7 +38,7 @@ http
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib1518
 </tool>
 
 <name>
index 7512330f26f66a5e4031447eee7276347c88a108..e75423a73c1c53c564d6101c3fc679efa7dab123 100644 (file)
@@ -69,7 +69,7 @@ lib%TESTNUMBER
 CURLFOLLOW_OBEYCODE with custom POST method, 302 => GET
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1571
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index edd2fdeafbe9d02e6cc0ae6bd00f083b8f87eb83..4c2329506ec3fd3deff018463abbcdfa545ddad0 100644 (file)
@@ -69,7 +69,7 @@ lib1571
 CURLFOLLOW_OBEYCODE with custom POST method, 308 => custom
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1571
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index 8a4af400f473f53acf783a967a1fc073061e164f..0e36d620f8ff6e5a3a1a298935616c7a00ab2afd 100644 (file)
@@ -69,7 +69,7 @@ lib1571
 CURLFOLLOW_OBEYCODE with custom GET method, 301 => custom
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1573
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index a191ed4c329b7f2d44e0b94414e02b47f8abe811..6afc24b2abaf801e08e90aacb8bdd20161fddc05 100644 (file)
@@ -69,7 +69,7 @@ lib1571
 CURLFOLLOW_FIRSTONLY with custom GET method, 301 => GET
 </name>
 <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1574
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index 90d49c99a895d04d105b8a1364c5713df6770abb..1d1e4b7ed3928df7bb6cbb59245edfb3cf63e2c3 100644 (file)
@@ -69,7 +69,7 @@ lib1571
 CURLFOLLOW_FIRSTONLY with custom POST method, 308 => POST
 </name>
 <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1575
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index 5ed2c23347ce162476a1e1a6398999fd5c8715c7..3b243bc632e290157ac7a1ff3333fbc029487f20 100644 (file)
@@ -69,7 +69,7 @@ lib%TESTNUMBER
 CURLFOLLOW_OBEYCODE with custom PUT method, 302 => custom
 </name>
 <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1576
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index d6ebb6e53f33a84136b3a32333fe847d706eaf3a..ba43782506aa4564ea60f28474daaf36d3b64e3e 100644 (file)
@@ -69,7 +69,7 @@ lib1576
 CURLFOLLOW_FIRSTONLY with custom PUT method, 302 => PUT
 </name>
 <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER %TESTNUMBER
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index a8e387a0f1484c885f1b2fc1fee4929992cf709e..98c78b613a353c439a6395039e13a6e8d1d5a940 100644 (file)
@@ -69,7 +69,7 @@ lib1571
 CURLFOLLOW_OBEYCODE with custom POST301 method, 301 => custom
  </name>
  <command>
-http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1581
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
 
index a2cb981b7283a91d2df1946dac58694771682f13..622623dc55bd425e0c82cd454a82712050b5f549 100644 (file)
@@ -33,7 +33,7 @@ mqtt
 MQTT PUBLISH with CURLOPT_POST set (no payload)
 </name>
 <tool>
-lib%TESTNUMBER
+lib1916
 </tool>
 <command option="binary-trace">
 "mqtt://%HOSTIP:%MQTTPORT/%20"
index 220df012b8b6f3215a648ae33421575c22799388..20854e16bad89400bdabf0f8012518fd6ba7e8f9 100644 (file)
@@ -44,7 +44,7 @@ http
 curl_easy_header with redirect but get headers from first request
 </name>
 <tool>
-lib%TESTNUMBER
+lib1940
 </tool>
 
 <command>
index 3a303e9a0065bf5b1cfdc45a713b2881f3c1aa60..2522af586b9032bd543717783d84cd7a0225454d 100644 (file)
@@ -27,7 +27,7 @@ file contents should appear once for each file
 ftp
 </server>
 <tool>
-lib%TESTNUMBER
+lib526
 </tool>
 <name>
 FTP RETR same file using different handles but same connection
index c92b377ef71b12891e90dfef564857b0bfbe5c39..243cc11d77460a5e0e1cb59af8dc72d59686414d 100644 (file)
@@ -20,7 +20,7 @@ multi
 ftp
 </server>
 <tool>
-lib%TESTNUMBER
+lib525
 </tool>
 <name>
 FTP PORT upload using multi interface (weird cleanup function sequence)
index 128b2d8802b57df976c9b53aef924c0967e7d76e..255c0551889fafa978cab5ed7eae259c767a0709 100644 (file)
@@ -27,7 +27,7 @@ file contents should appear once for each file
 ftp
 </server>
 <tool>
-lib%TESTNUMBER
+lib526
 </tool>
 <name>
 FTP RETR same file using reset handles between each transfer
index 1401ebc5eafefe843b5b645e771c17ee3157dcca..0bdb6281536ea97f0c334129c50d9c0bbd86eee2 100644 (file)
@@ -26,7 +26,7 @@ http
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib544
 </tool>
 
 <name>
index 98b43642bd20b8201cfc0e7ec1f5c3c350b79961..2ad40e4589dfc0a77b7faa1ec30c3fac7e1481ff 100644 (file)
@@ -73,7 +73,7 @@ http
 </server>
 # tool to use
 <tool>
-lib%TESTNUMBER
+lib547
 </tool>
 <features>
 NTLM
index cd398a743549e0939c573d72959155fdbd620501..a6b29e17c201cc7a022bac365b9e34e8ecbeae13 100644 (file)
@@ -63,7 +63,7 @@ crypto
 </features>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib510
 </tool>
 
 <name>
index a263e71879e6fb4699b6e21d0713b89108ec6442..81c9b840377138832d71bd7be3d40903a838470a 100644 (file)
@@ -44,7 +44,7 @@ http
 </server>
 # tool to invoke
 <tool>
-lib%TESTNUMBER
+lib589
 </tool>
 
 <name>
index 393498c61387c2b5ffb4f3cc63c66dee9904aef1..e5138cdb175585afa7bf63ffc3d0bd2b1efa5352 100644 (file)
@@ -43,7 +43,7 @@ http
 </features>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib500
 </tool>
 
 <name>
index a708f3b5958491fe390356e58e64f3ff94baee46..b1cd990025032c720da0bc87e03e5489829d4b95 100644 (file)
@@ -32,7 +32,7 @@ last line
 ftp
 </server>
 <tool>
-lib585
+lib500
 </tool>
 <name>
 FTP and open/close socket callbacks
index c896a5b6bfdb05b89c153ca396e39607d55af319..44e1fb047d9167220484c72a77b3cc710f394c67 100644 (file)
@@ -25,7 +25,7 @@ http
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib554
 </tool>
 
 <name>
index 13d6bb927dc88e0a1e0d0a118793cbc045b58836..9a80aa7e262a607dc4bb5ef9d26ea01cccf17c4b 100644 (file)
@@ -29,7 +29,7 @@ ftp
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib585
+lib500
 </tool>
 
 <name>
index 30e401df7af354e02829a290afbb714f9eef8f4d..38f24ab92cfb13da35e8dd546522f3dd7f0e28d1 100644 (file)
@@ -29,7 +29,7 @@ ftp
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib585
+lib500
 </tool>
 
 <name>
index 68c78ce9a14c749fd435754415969b3ddba8c334..c198cbbaeb73efc960c973237839a04934f11b0c 100644 (file)
@@ -47,7 +47,7 @@ http
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib643
 </tool>
 
 <name>
index e49aacd51ae209e4a83ebb4fa45ff45b14562253..310a902b147b51b7952c498ed5994db3923c9085 100644 (file)
@@ -40,7 +40,7 @@ http
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib670
 </tool>
 
 <name>
index 387058d891d8a2ced7e4f3d9fe5de32bc5a45848..e295b2f07b5bbb902b1fc18f819f7b480ab9dd1d 100644 (file)
@@ -40,7 +40,7 @@ http
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib670
 </tool>
 
 <name>
index 5cc3e015a3a9e9bea45d4ccb9a3f390ae3c7444a..e4db3cf83a015f83e8bb2d71c3f7a95d9720b19d 100644 (file)
@@ -40,7 +40,7 @@ http
 </server>
 # tool is what to use instead of 'curl'
 <tool>
-lib%TESTNUMBER
+lib670
 </tool>
 
 <name>
index 1af5fc7a841e9ce877235dcc87eae841028678b6..2b53c4fc9873a44d85c2b16bf8bf6e205dbb6fc9 100644 (file)
@@ -25,7 +25,7 @@ Connection: close
 http
 </server>
 <tool>
-lib%TESTNUMBER
+lib556
 </tool>
 <name>
 CONNECT_ONLY and doing a second curl_easy_perform
index d8c5e14c3d5ab18079d74372e00b178887ff46a8..987eecb1440e65cf538e09afdc17325eb8e03451 100644 (file)
@@ -38,18 +38,17 @@ SUPPORTFILES = $(TIMEDIFF) $(FIRSTFILES) test.h
 LIBTESTPROGS = libauthretry libntlmconnect libprereq                     \
  lib500 lib501 lib502 lib503 lib504 lib505 lib506 lib507 lib508 lib509   \
  lib510 lib511 lib512 lib513 lib514 lib515 lib516 lib517 lib518 lib519   \
- lib520 lib521 lib523 lib524 lib525 lib526 lib527 lib529 lib530 lib532   \
+ lib520 lib521 lib523 lib524 lib525 lib526               lib530          \
  lib533               lib536 lib537 lib539 lib540 lib541 lib542 lib543   \
- lib544 lib545                                                           \
- lib547 lib548 lib549 lib552 lib553 lib554 lib555 lib556 lib557 lib558   \
- lib559 lib560 lib562 lib564 lib565 lib566 lib567 lib568 lib569 lib570   \
+ lib544                                                                  \
+ lib547        lib549 lib552 lib553 lib554 lib555 lib556 lib557 lib558   \
+ lib559 lib560 lib562 lib564        lib566 lib567 lib568 lib569 lib570   \
  lib571 lib572 lib573 lib574 lib575 lib576        lib578 lib579 lib582   \
- lib583 lib584 lib585 lib586 lib587 lib589 lib590 lib591 lib597 lib598   \
+ lib583               lib586        lib589 lib590 lib591 lib597 lib598   \
  lib599 \
- lib643        lib645 lib650 lib651 lib652 lib653 lib654 lib655 lib658   \
+ lib643               lib650 lib651 lib652 lib653 lib654 lib655 lib658   \
  lib659 lib661 lib666 lib667 lib668 \
- lib670 lib671 lib672 lib673 lib674 lib676 lib677 lib678 lib694 lib695   \
- lib696 \
+ lib670                      lib674 lib676 lib677 lib678 lib694 lib695   \
  lib751 \
  lib1156 \
  lib1301 \
@@ -59,8 +58,8 @@ LIBTESTPROGS = libauthretry libntlmconnect libprereq                     \
  lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515         lib1517 \
  lib1518         lib1520 lib1521 lib1522 lib1523 \
  lib1525 lib1526 lib1527 lib1528 lib1529 lib1530 lib1531 lib1532 lib1533 \
- lib1534 lib1535 lib1536 lib1537 lib1538 lib1539 \
- lib1540 lib1541 lib1542 lib1543         lib1545 \
+ lib1534 lib1535 lib1536 lib1537 lib1538 \
+ lib1540 lib1541 lib1542                 lib1545 \
  lib1550 lib1551 lib1552 lib1553 lib1554 lib1555 lib1556 lib1557 \
  lib1558 lib1559 lib1560 lib1564 lib1565 lib1567 lib1568 lib1569 lib1571 \
                          lib1576 \
@@ -70,9 +69,9 @@ LIBTESTPROGS = libauthretry libntlmconnect libprereq                     \
  \
  lib1900 lib1901 \
  lib1903 lib1905 lib1906 lib1907 lib1908 lib1910 lib1911 lib1912 lib1913 \
-         lib1915 lib1916 lib1917 lib1918 lib1919 \
+         lib1915 lib1916         lib1918 lib1919 \
  lib1933 lib1934 lib1935 lib1936 lib1937 lib1938 lib1939 lib1940 \
- lib1945 lib1946 lib1947 lib1948 lib1955 lib1956 lib1957 lib1958 lib1959 \
+ lib1945         lib1947 lib1948 lib1955 lib1956 lib1957 lib1958 lib1959 \
  lib1960 lib1964 \
  lib1970 lib1971 lib1972 lib1973 lib1974 lib1975 lib1977 lib1978 \
  lib2301 lib2302 lib2304 lib2306 lib2308 lib2309 \
@@ -151,23 +150,10 @@ lib525_LDADD = $(TESTUTIL_LIBS)
 
 lib526_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib526_LDADD = $(TESTUTIL_LIBS)
-lib526_CPPFLAGS = $(AM_CPPFLAGS) -DLIB526
-
-lib527_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib527_LDADD = $(TESTUTIL_LIBS)
-lib527_CPPFLAGS = $(AM_CPPFLAGS) -DLIB527
-
-lib529_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
-lib529_LDADD = $(TESTUTIL_LIBS)
-lib529_CPPFLAGS = $(AM_CPPFLAGS) -DLIB529
 
 lib530_SOURCES = lib530.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib530_LDADD = $(TESTUTIL_LIBS)
 
-lib532_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib532_LDADD = $(TESTUTIL_LIBS)
-lib532_CPPFLAGS = $(AM_CPPFLAGS) -DLIB532
-
 lib533_SOURCES = lib533.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib533_LDADD = $(TESTUTIL_LIBS)
 
@@ -189,14 +175,8 @@ lib543_SOURCES = lib543.c $(SUPPORTFILES)
 
 lib544_SOURCES = lib544.c $(SUPPORTFILES)
 
-lib545_SOURCES = lib544.c $(SUPPORTFILES)
-lib545_CPPFLAGS = $(AM_CPPFLAGS) -DLIB545
-
 lib547_SOURCES = lib547.c $(SUPPORTFILES)
 
-lib548_SOURCES = lib547.c $(SUPPORTFILES)
-lib548_CPPFLAGS = $(AM_CPPFLAGS) -DLIB548
-
 lib549_SOURCES = lib549.c $(SUPPORTFILES)
 
 lib552_SOURCES = lib552.c $(SUPPORTFILES) $(WARNLESS)
@@ -224,9 +204,6 @@ lib562_SOURCES = lib562.c $(SUPPORTFILES)
 lib564_SOURCES = lib564.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib564_LDADD = $(TESTUTIL_LIBS)
 
-lib565_SOURCES = lib510.c $(SUPPORTFILES)
-lib565_CPPFLAGS = $(AM_CPPFLAGS) -DLIB565
-
 lib566_SOURCES = lib566.c $(SUPPORTFILES) $(MULTIBYTE)
 
 lib567_SOURCES = lib567.c $(SUPPORTFILES)
@@ -265,17 +242,8 @@ lib582_LDADD = $(TESTUTIL_LIBS)
 
 lib583_SOURCES = lib583.c $(SUPPORTFILES)
 
-lib584_SOURCES = lib589.c $(SUPPORTFILES)
-lib584_CPPFLAGS = $(AM_CPPFLAGS) -DLIB584
-
-lib585_SOURCES = lib500.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(MULTIBYTE)
-lib585_LDADD = $(TESTUTIL_LIBS)
-lib585_CPPFLAGS = $(AM_CPPFLAGS) -DLIB585
-
 lib586_SOURCES = lib586.c $(SUPPORTFILES)
 
-lib587_SOURCES = lib587.c $(SUPPORTFILES)
-
 lib589_SOURCES = lib589.c $(SUPPORTFILES)
 
 lib590_SOURCES = lib590.c $(SUPPORTFILES)
@@ -292,8 +260,6 @@ lib599_SOURCES = lib599.c $(SUPPORTFILES) $(MULTIBYTE)
 
 lib643_SOURCES = lib643.c $(SUPPORTFILES)
 
-lib645_SOURCES = lib645.c $(SUPPORTFILES)
-
 lib650_SOURCES = lib650.c $(SUPPORTFILES)
 
 lib651_SOURCES = lib651.c $(SUPPORTFILES)
@@ -324,18 +290,6 @@ lib668_LDADD = $(TESTUTIL_LIBS)
 
 lib670_SOURCES = lib670.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib670_LDADD = $(TESTUTIL_LIBS)
-lib670_CPPFLAGS = $(AM_CPPFLAGS) -DLIB670
-
-lib671_SOURCES = lib670.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib671_LDADD = $(TESTUTIL_LIBS)
-lib671_CPPFLAGS = $(AM_CPPFLAGS) -DLIB671
-
-lib672_SOURCES = lib670.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib672_LDADD = $(TESTUTIL_LIBS)
-lib672_CPPFLAGS = $(AM_CPPFLAGS) -DLIB672
-
-lib673_SOURCES = lib670.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib673_LDADD = $(TESTUTIL_LIBS)
 
 lib674_SOURCES = lib674.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib674_LDADD = $(TESTUTIL_LIBS)
@@ -353,9 +307,6 @@ lib694_SOURCES = lib694.c $(SUPPORTFILES)
 
 lib695_SOURCES = lib695.c $(SUPPORTFILES)
 
-lib696_SOURCES = lib556.c $(SUPPORTFILES) $(WARNLESS)
-lib696_CPPFLAGS = $(AM_CPPFLAGS) -DLIB696
-
 lib751_SOURCES = lib751.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib751_LDADD = $(TESTUTIL_LIBS)
 
@@ -466,10 +417,6 @@ lib1537_LDADD = $(TESTUTIL_LIBS)
 lib1538_SOURCES = lib1538.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
 lib1538_LDADD = $(TESTUTIL_LIBS)
 
-lib1539_SOURCES = lib1514.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
-lib1539_LDADD = $(TESTUTIL_LIBS)
-lib1539_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1539
-
 lib1540_SOURCES = lib1540.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
 lib1540_LDADD = $(TESTUTIL_LIBS)
 
@@ -479,9 +426,6 @@ lib1541_LDADD = $(TESTUTIL_LIBS)
 lib1542_SOURCES = lib1542.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
 lib1542_LDADD = $(TESTUTIL_LIBS)
 
-lib1543_SOURCES = lib1518.c $(SUPPORTFILES)
-lib1543_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1543
-
 lib1545_SOURCES = lib1545.c $(SUPPORTFILES)
 
 lib1550_SOURCES = lib1550.c $(SUPPORTFILES)
@@ -527,7 +471,6 @@ lib1568_SOURCES = lib1568.c $(SUPPORTFILES)
 lib1569_SOURCES = lib1569.c $(SUPPORTFILES)
 
 lib1571_SOURCES = lib1571.c $(SUPPORTFILES)
-lib1571_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1571
 
 lib1576_SOURCES = lib1576.c $(SUPPORTFILES)
 
@@ -588,9 +531,6 @@ lib1915_LDADD = $(TESTUTIL_LIBS)
 
 lib1916_SOURCES = lib1916.c $(SUPPORTFILES) $(WARNLESS)
 
-lib1917_SOURCES = lib1916.c $(SUPPORTFILES) $(WARNLESS)
-lib1917_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1917
-
 lib1918_SOURCES = lib1918.c $(SUPPORTFILES) $(WARNLESS)
 
 lib1919_SOURCES = lib1919.c $(SUPPORTFILES) $(WARNLESS)
@@ -622,10 +562,6 @@ lib1940_LDADD = $(TESTUTIL_LIBS)
 lib1945_SOURCES = lib1945.c $(SUPPORTFILES)
 lib1945_LDADD = $(TESTUTIL_LIBS)
 
-lib1946_SOURCES = lib1940.c $(SUPPORTFILES)
-lib1946_LDADD = $(TESTUTIL_LIBS)
-lib1946_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1946
-
 lib1947_SOURCES = lib1947.c $(SUPPORTFILES)
 lib1947_LDADD = $(TESTUTIL_LIBS)
 
index 9596fb76858c9ac30790fb02bef4b543b1e7fc23..612fad8f4e9a2844c946c21e4d60a18a0efc08f0 100644 (file)
@@ -30,8 +30,6 @@
 
 #include "memdebug.h"
 
-#ifndef LIB1514_C
-#define LIB1514_C
 struct t1514_WriteThis {
   char *readptr;
   size_t sizeleft;
@@ -53,7 +51,6 @@ static size_t t1514_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
 
   return 0;                         /* no more data left to deliver */
 }
-#endif
 
 CURLcode test(char *URL)
 {
@@ -74,10 +71,11 @@ CURLcode test(char *URL)
   /* Purposely omit to set CURLOPT_POSTFIELDSIZE */
   easy_setopt(curl, CURLOPT_READFUNCTION, t1514_read_cb);
   easy_setopt(curl, CURLOPT_READDATA, &pooh);
-#ifdef LIB1539
-  /* speak HTTP 1.0 - no chunked! */
-  easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
-#endif
+
+  if(testnum == 1539) {
+    /* speak HTTP 1.0 - no chunked! */
+    easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+  }
 
   result = curl_easy_perform(curl);
 
index 2278d1f4c07df97caf14a469a31294ddbf11d203..d317169ceba73b1b8d1788f285ab64b2881724a5 100644 (file)
@@ -27,8 +27,6 @@
 
 /* Test inspired by github issue 3340 */
 
-#ifndef LIB1518_C
-#define LIB1518_C
 static size_t t1518_write_cb(char *buffer, size_t size, size_t nitems,
                              void *outstream)
 {
@@ -38,7 +36,6 @@ static size_t t1518_write_cb(char *buffer, size_t size, size_t nitems,
   (void)outstream;
   return 0;
 }
-#endif
 
 CURLcode test(char *URL)
 {
@@ -48,18 +45,15 @@ CURLcode test(char *URL)
   long curlRedirectCount;
   char *effectiveUrl = NULL;
   char *redirectUrl = NULL;
-#ifdef LIB1543
   CURLU *urlu = NULL;
-#endif
   curl = curl_easy_init();
   if(!curl) {
     curl_mfprintf(stderr, "curl_easy_init() failed\n");
     curl_global_cleanup();
     return TEST_ERR_MAJOR_BAD;
   }
-#ifdef LIB1543
-  /* set CURLOPT_URLU */
-  {
+  if(testnum == 1543) {
+    /* set CURLOPT_URLU */
     CURLUcode rc = CURLUE_OK;
     urlu = curl_url();
     if(urlu)
@@ -68,14 +62,13 @@ CURLcode test(char *URL)
       goto test_cleanup;
     }
     test_setopt(curl, CURLOPT_CURLU, urlu);
+    test_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+  }
+  else {
+    test_setopt(curl, CURLOPT_URL, URL);
+    /* just to make it explicit and visible in this test: */
+    test_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L);
   }
-  test_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
-#else
-  test_setopt(curl, CURLOPT_URL, URL);
-  /* just to make it explicit and visible in this test: */
-  test_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L);
-#endif
-
 
   /* Perform the request, res will get the return code */
   res = curl_easy_perform(curl);
@@ -104,8 +97,7 @@ test_cleanup:
   /* always cleanup */
   curl_easy_cleanup(curl);
   curl_global_cleanup();
-#ifdef LIB1543
-  curl_url_cleanup(urlu);
-#endif
+  if(testnum == 1543)
+    curl_url_cleanup(urlu);
   return res;
 }
index 599475742e2cf7e1ad7e32a685d7af8aca964525..faf178a6fbbe299304e1253e26302a94a48d57a9 100644 (file)
@@ -29,7 +29,6 @@ CURLcode test(char *URL)
 {
   CURLcode res;
   CURL *curl;
-  int testno = atoi(libtest_arg2);
 
   if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
     curl_mfprintf(stderr, "curl_global_init() failed\n");
@@ -46,15 +45,16 @@ CURLcode test(char *URL)
   test_setopt(curl, CURLOPT_HEADER, 1L);
   test_setopt(curl, CURLOPT_VERBOSE, 1L);
   test_setopt(curl, CURLOPT_URL, URL);
-  if((testno == 1571) || (testno == 1575) || (testno == 1581)) {
+  if((testnum == 1571) || (testnum == 1572) ||
+     (testnum == 1575) || (testnum == 1581)) {
     test_setopt(curl, CURLOPT_POSTFIELDS, "moo");
   }
-  if(testno == 1581) {
+  if(testnum == 1581) {
     test_setopt(curl, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_301);
   }
 
   test_setopt(curl, CURLOPT_CUSTOMREQUEST, "IGLOO");
-  if((testno == 1574) || (testno == 1575)) {
+  if((testnum == 1574) || (testnum == 1575)) {
     test_setopt(curl, CURLOPT_FOLLOWLOCATION, CURLFOLLOW_FIRSTONLY);
   }
   else {
index 98a7a6c7b1f00959a3ed299464f788f97e7ecb06..df34a9a205aa8274acfcb56e6110cdb82199b156 100644 (file)
@@ -52,7 +52,6 @@ CURLcode test(char *URL)
   CURLcode res;
   CURL *curl;
   struct curl_slist *pHeaderList = NULL;
-  int testno = atoi(libtest_arg2);
 
   if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
     curl_mfprintf(stderr, "curl_global_init() failed\n");
@@ -75,7 +74,7 @@ CURLcode test(char *URL)
   test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(t1576_testdata));
 
   test_setopt(curl, CURLOPT_CUSTOMREQUEST, "CURL");
-  if(testno == 1578) {
+  if(testnum == 1578 || testnum == 1580) {
     test_setopt(curl, CURLOPT_FOLLOWLOCATION, CURLFOLLOW_FIRSTONLY);
   }
   else {
index b8655191eee2289074bf8b0e04e15f9b9e63a277..ca9bdea34b6508092c2377da4433d154f97b7a7d 100644 (file)
@@ -39,12 +39,13 @@ CURLcode test(char *URL)
   curl = curl_easy_init();
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, URL);
-#ifdef LIB1917
-    /* without any postfields set! */
-    curl_easy_setopt(curl, CURLOPT_POST, 1L);
-#else
-    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "");
-#endif
+    if(testnum == 1917) {
+      /* without any postfields set! */
+      curl_easy_setopt(curl, CURLOPT_POST, 1L);
+    }
+    else {
+      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "");
+    }
     res = curl_easy_perform(curl);
     if(res) {
       curl_mprintf("res: %d\n", res);
index 60b14f02a5cfdbe56d4ec7bca35dd7409fd7e099..a7b8f5b168802571752ed800656301fef0f93eaa 100644 (file)
@@ -26,9 +26,6 @@
 
 #include "memdebug.h"
 
-#ifndef LIB1940_C
-#define LIB1940_C
-
 static size_t t1940_write_cb(char *data, size_t n, size_t l, void *userp)
 {
   /* take care of the data here, ignored in this example */
@@ -80,7 +77,6 @@ static void t1940_showem(CURL *easy, int header_request, unsigned int type)
     }
   }
 }
-#endif
 
 CURLcode test(char *URL)
 {
@@ -88,11 +84,12 @@ CURLcode test(char *URL)
   CURLcode res = CURLE_OK;
 
   int header_request;
-#ifdef LIB1946
-  header_request = 0;
-#else
-  header_request = -1;
-#endif
+  if(testnum == 1946) {
+    header_request = 0;
+  }
+  else {
+    header_request = -1;
+  }
 
   global_init(CURL_GLOBAL_DEFAULT);
   easy_init(easy);
index e7623e5aaa5678dcd29f6a5a8fe47318cda04263..425d1ef16f674bdec1090b337ff4c7707af9396e 100644 (file)
@@ -26,8 +26,6 @@
 #include "testtrace.h"
 #include "memdebug.h"
 
-#ifdef LIB585
-
 static int testcounter;
 
 static curl_socket_t tst_opensocket(void *clientp,
@@ -54,9 +52,6 @@ static void setupcallbacks(CURL *curl)
   testcounter = 0;
 }
 
-#endif
-
-
 CURLcode test(char *URL)
 {
   CURLcode res;
@@ -87,9 +82,8 @@ CURLcode test(char *URL)
   if(libtest_arg3 && !strcmp(libtest_arg3, "activeftp"))
     test_setopt(curl, CURLOPT_FTPPORT, "-");
 
-#ifdef LIB585
-  setupcallbacks(curl);
-#endif
+  if(testnum == 585 || testnum == 586 || testnum == 595 || testnum == 596)
+    setupcallbacks(curl);
 
   res = curl_easy_perform(curl);
 
index 4be925917a8cb24907600ce575c8bd8b4b5b8af5..0869b04abf1358436d2fc7628c38f293da7cf4d8 100644 (file)
@@ -25,9 +25,6 @@
 
 #include "memdebug.h"
 
-#ifndef LIB510_C
-#define LIB510_C
-
 struct t510_WriteThis {
   int counter;
 };
@@ -62,7 +59,6 @@ static size_t t510_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
   }
   return 0;                         /* no more data left to deliver */
 }
-#endif
 
 CURLcode test(char *URL)
 {
@@ -113,10 +109,10 @@ CURLcode test(char *URL)
   /* enforce chunked transfer by setting the header */
   test_setopt(curl, CURLOPT_HTTPHEADER, slist);
 
-#ifdef LIB565
-  test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST);
-  test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
-#endif
+  if(testnum == 565) {
+    test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST);
+    test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
+  }
 
   /* Perform the request, res will get the return code */
   res = curl_easy_perform(curl);
index 22be567ff7cad3b23c40acb88b29e360a8d7e11e..16f9a6e9b369a6725a42b42d27ac7a569d7414fc 100644 (file)
@@ -42,13 +42,12 @@ CURLcode test(char *URL)
   start_test_timing();
 
   if(!libtest_arg2) {
-#ifdef LIB529
-    /* test 529 */
-    curl_mfprintf(stderr, "Usage: lib529 [url] [uploadfile]\n");
-#else
-    /* test 525 */
-    curl_mfprintf(stderr, "Usage: lib525 [url] [uploadfile]\n");
-#endif
+    if(testnum == 529) {
+      curl_mfprintf(stderr, "Usage: lib529 [url] [uploadfile]\n");
+    }
+    else { /* testnum == 525 */
+      curl_mfprintf(stderr, "Usage: lib525 [url] [uploadfile]\n");
+    }
     return TEST_ERR_USAGE;
   }
 
@@ -143,21 +142,20 @@ CURLcode test(char *URL)
 
 test_cleanup:
 
-#ifdef LIB529
-  /* test 529 */
-  /* proper cleanup sequence - type PA */
-  curl_multi_remove_handle(m, curl);
-  curl_multi_cleanup(m);
-  curl_easy_cleanup(curl);
-  curl_global_cleanup();
-#else
-  /* test 525 */
-  /* proper cleanup sequence - type PB */
-  curl_multi_remove_handle(m, curl);
-  curl_easy_cleanup(curl);
-  curl_multi_cleanup(m);
-  curl_global_cleanup();
-#endif
+  if(testnum == 529) {
+    /* proper cleanup sequence - type PA */
+    curl_multi_remove_handle(m, curl);
+    curl_multi_cleanup(m);
+    curl_easy_cleanup(curl);
+    curl_global_cleanup();
+  }
+  else { /* testnum == 525 */
+    /* proper cleanup sequence - type PB */
+    curl_multi_remove_handle(m, curl);
+    curl_easy_cleanup(curl);
+    curl_multi_cleanup(m);
+    curl_global_cleanup();
+  }
 
   /* close the local file */
   fclose(hd_src);
index e56f299a9ade0f7ae25f9e5202a40e5466e82f74..3b068488a55e47287d4f1c98d88b500cc7b7cb24 100644 (file)
  * sharing within the multi handle all transfers are performed on the same
  * persistent connection.
  *
- * This source code is used for lib526, lib527 and lib532 with only #ifdefs
+ * This source code is used for test526, test527 and test532 with branches
  * controlling the small differences.
  *
- * - lib526 closes all easy handles after
+ * - test526 closes all easy handles after
  *   they all have transferred the file over the single connection
- * - lib527 closes each easy handle after each single transfer.
- * - lib532 uses only a single easy handle that is removed, reset and then
+ * - test527 closes each easy handle after each single transfer.
+ * - test532 uses only a single easy handle that is removed, reset and then
  *   re-added for each transfer
  *
  * Test case 526, 527 and 532 use FTP, while test 528 uses the lib526 tool but
@@ -92,16 +92,19 @@ CURLcode test(char *URL)
     abort_on_test_timeout();
 
     if(!running) {
-#ifdef LIB527
-      /* NOTE: this code does not remove the handle from the multi handle
-         here, which would be the nice, sane and documented way of working.
-         This however tests that the API survives this abuse gracefully. */
-      curl_easy_cleanup(curl[current]);
-      curl[current] = NULL;
-#endif
+
+      if(testnum == 527) {
+        /* NOTE: this code does not remove the handle from the multi handle
+           here, which would be the nice, sane and documented way of working.
+           This however tests that the API survives this abuse gracefully. */
+        curl_easy_cleanup(curl[current]);
+        curl[current] = NULL;
+      }
+
       if(++current < NUM_HANDLES) {
         curl_mfprintf(stderr, "Advancing to URL %d\n", current);
-#ifdef LIB532
+
+        if(testnum == 532) {
         /* first remove the only handle we use */
         curl_multi_remove_handle(m, curl[0]);
 
@@ -114,9 +117,10 @@ CURLcode test(char *URL)
 
         /* re-add it */
         multi_add_handle(m, curl[0]);
-#else
-        multi_add_handle(m, curl[current]);
-#endif
+        }
+        else {
+          multi_add_handle(m, curl[current]);
+        }
       }
       else {
         break; /* done */
@@ -138,45 +142,37 @@ CURLcode test(char *URL)
 
 test_cleanup:
 
-#if defined(LIB526)
-
-  /* test 526 and 528 */
-  /* proper cleanup sequence - type PB */
+  if(testnum == 526 || testnum == 528) {
+    /* proper cleanup sequence - type PB */
 
-  for(i = 0; i < NUM_HANDLES; i++) {
-    curl_multi_remove_handle(m, curl[i]);
-    curl_easy_cleanup(curl[i]);
+    for(i = 0; i < NUM_HANDLES; i++) {
+      curl_multi_remove_handle(m, curl[i]);
+      curl_easy_cleanup(curl[i]);
+    }
+    curl_multi_cleanup(m);
+    curl_global_cleanup();
   }
-  curl_multi_cleanup(m);
-  curl_global_cleanup();
-
-#elif defined(LIB527)
-
-  /* test 527 */
-
-  /* Upon non-failure test flow the easy's have already been cleanup'ed. In
-     case there is a failure we arrive here with easy's that have not been
-     cleanup'ed yet, in this case we have to cleanup them or otherwise these
-     will be leaked, let's use undocumented cleanup sequence - type UB */
+  else if(testnum == 527) {
+    /* Upon non-failure test flow the easy's have already been cleanup'ed. In
+       case there is a failure we arrive here with easy's that have not been
+       cleanup'ed yet, in this case we have to cleanup them or otherwise these
+       will be leaked, let's use undocumented cleanup sequence - type UB */
+
+    if(res != CURLE_OK)
+      for(i = 0; i < NUM_HANDLES; i++)
+        curl_easy_cleanup(curl[i]);
+
+    curl_multi_cleanup(m);
+    curl_global_cleanup();
+  }
+  else { /* testnum == 532 */
+    /* undocumented cleanup sequence - type UB */
 
-  if(res != CURLE_OK)
     for(i = 0; i < NUM_HANDLES; i++)
       curl_easy_cleanup(curl[i]);
-
-  curl_multi_cleanup(m);
-  curl_global_cleanup();
-
-#elif defined(LIB532)
-
-  /* test 532 */
-  /* undocumented cleanup sequence - type UB */
-
-  for(i = 0; i < NUM_HANDLES; i++)
-    curl_easy_cleanup(curl[i]);
-  curl_multi_cleanup(m);
-  curl_global_cleanup();
-
-#endif
+    curl_multi_cleanup(m);
+    curl_global_cleanup();
+  }
 
   return res;
 }
index fd62e32c21ed6e28b4c82e1475dcb73a3bd59ca8..b12e3483e6097665ba64c32b1d5bcf8ebf800fb2 100644 (file)
@@ -55,9 +55,8 @@ CURLcode test(char *URL)
   /* First set the URL that is about to receive our POST. */
   test_setopt(curl, CURLOPT_URL, URL);
 
-#ifdef LIB545
-  test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(teststring));
-#endif
+  if(testnum == 545)
+    test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(teststring));
 
   test_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring);
 
index 24b97adc22e20090ed725e777371a50f38934860..c24619db5795b461cc165b9e349b17d29caea41b 100644 (file)
@@ -32,7 +32,6 @@
 
 #define UPLOADTHIS "this is the blurb we want to upload\n"
 
-#ifndef LIB548
 static size_t t547_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp)
 {
   int *counter = (int *)clientp;
@@ -63,15 +62,12 @@ static curlioerr t547_ioctl_callback(CURL *handle, int cmd, void *clientp)
   }
   return CURLIOE_OK;
 }
-#endif
 
 CURLcode test(char *URL)
 {
   CURLcode res;
   CURL *curl;
-#ifndef LIB548
   int counter = 0;
-#endif
 
   if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
     curl_mfprintf(stderr, "curl_global_init() failed\n");
@@ -88,20 +84,21 @@ CURLcode test(char *URL)
   test_setopt(curl, CURLOPT_URL, URL);
   test_setopt(curl, CURLOPT_VERBOSE, 1L);
   test_setopt(curl, CURLOPT_HEADER, 1L);
-#ifdef LIB548
-  /* set the data to POST with a mere pointer to a null-terminated string */
-  test_setopt(curl, CURLOPT_POSTFIELDS, UPLOADTHIS);
-#else
-  /* 547 style, which means reading the POST data from a callback */
-  test_setopt(curl, CURLOPT_IOCTLFUNCTION, t547_ioctl_callback);
-  test_setopt(curl, CURLOPT_IOCTLDATA, &counter);
-
-  test_setopt(curl, CURLOPT_READFUNCTION, t547_read_cb);
-  test_setopt(curl, CURLOPT_READDATA, &counter);
-  /* We CANNOT do the POST fine without setting the size (or choose
-     chunked)! */
-  test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(UPLOADTHIS));
-#endif
+  if(testnum == 548) {
+    /* set the data to POST with a mere pointer to a null-terminated string */
+    test_setopt(curl, CURLOPT_POSTFIELDS, UPLOADTHIS);
+  }
+  else {
+    /* 547 style, which means reading the POST data from a callback */
+    test_setopt(curl, CURLOPT_IOCTLFUNCTION, t547_ioctl_callback);
+    test_setopt(curl, CURLOPT_IOCTLDATA, &counter);
+
+    test_setopt(curl, CURLOPT_READFUNCTION, t547_read_cb);
+    test_setopt(curl, CURLOPT_READDATA, &counter);
+    /* We CANNOT do the POST fine without setting the size (or choose
+       chunked)! */
+    test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(UPLOADTHIS));
+  }
   test_setopt(curl, CURLOPT_POST, 1L);
   test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
   test_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
index 5c7db7a4e56b38fc347b81c65eb34496c9bbfb55..f5df319ec01252024427c0909343ac22376db261 100644 (file)
@@ -38,13 +38,22 @@ static size_t t554_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
     return 0;
 
   if(pooh->sizeleft) {
-    *ptr = pooh->readptr[0]; /* copy one single byte */
-    pooh->readptr++;                 /* advance pointer */
-    pooh->sizeleft--;                /* less data left */
-    return 1;                        /* we return 1 byte at a time! */
+    *ptr = pooh->readptr[0];  /* copy one single byte */
+    pooh->readptr++;          /* advance pointer */
+    pooh->sizeleft--;         /* less data left */
+    return 1;                 /* we return 1 byte at a time! */
   }
 
-  return 0;                         /* no more data left to deliver */
+  return 0;                   /* no more data left to deliver */
+}
+
+static size_t t587_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
+{
+  (void)ptr;
+  (void)size;
+  (void)nmemb;
+  (void)userp;
+  return CURL_READFUNC_ABORT;
 }
 
 static CURLcode t554_test_once(char *URL, bool oldstyle)
@@ -153,7 +162,12 @@ static CURLcode t554_test_once(char *URL, bool oldstyle)
   test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
 
   /* we want to use our own read function */
-  test_setopt(curl, CURLOPT_READFUNCTION, t554_read_cb);
+  if(testnum == 587) {
+    test_setopt(curl, CURLOPT_READFUNCTION, t587_read_cb);
+  }
+  else {
+    test_setopt(curl, CURLOPT_READFUNCTION, t554_read_cb);
+  }
 
   /* send a multi-part formpost */
   test_setopt(curl, CURLOPT_HTTPPOST, formpost);
index 9da9da368e4e672d8e20332404e315f2f0eb9038..70cbc903601233d6e485a9d285107f3e7b5f32c5 100644 (file)
@@ -68,7 +68,6 @@ static curlioerr t555_ioctl_callback(CURL *handle, int cmd, void *clientp)
   return CURLIOE_OK;
 }
 
-
 CURLcode test(char *URL)
 {
   CURLcode res = CURLE_OK;
index c3eeea18148372679e2b3a7c648ab86e068a6a5f..e3daabd4a7b908591c41561c6a12fd8daa6dd7b9 100644 (file)
@@ -30,9 +30,7 @@ CURLcode test(char *URL)
 {
   CURLcode res;
   CURL *curl;
-#ifdef LIB696
   int transfers = 0;
-#endif
 
   if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
     curl_mfprintf(stderr, "curl_global_init() failed\n");
@@ -50,9 +48,7 @@ CURLcode test(char *URL)
   test_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
   test_setopt(curl, CURLOPT_VERBOSE, 1L);
 
-#ifdef LIB696
 again:
-#endif
 
   res = curl_easy_perform(curl);
 
@@ -101,12 +97,12 @@ again:
       res = TEST_ERR_FAILURE;
   }
 
-#ifdef LIB696
-  ++transfers;
-  /* perform the transfer a second time */
-  if(!res && transfers == 1)
-    goto again;
-#endif
+  if(testnum == 696) {
+    ++transfers;
+    /* perform the transfer a second time */
+    if(!res && transfers == 1)
+      goto again;
+  }
 
 test_cleanup:
 
diff --git a/tests/libtest/lib587.c b/tests/libtest/lib587.c
deleted file mode 100644 (file)
index ea9862e..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at https://curl.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * SPDX-License-Identifier: curl
- *
- ***************************************************************************/
-#include "test.h"
-
-#include "memdebug.h"
-
-struct t587_WriteThis {
-  const char *readptr;
-  size_t sizeleft;
-};
-
-static size_t t587_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
-{
-  (void)ptr;
-  (void)size;
-  (void)nmemb;
-  (void)userp;
-  return CURL_READFUNC_ABORT;
-}
-
-static CURLcode t587_test_once(char *URL, bool oldstyle)
-{
-  static const char testdata[] =
-    "this is what we post to the silly web server\n";
-
-  CURL *curl;
-  CURLcode res = CURLE_OK;
-  CURLFORMcode formrc;
-
-  struct curl_httppost *formpost = NULL;
-  struct curl_httppost *lastptr = NULL;
-  struct t587_WriteThis pooh;
-  struct t587_WriteThis pooh2;
-
-  pooh.readptr = testdata;
-  pooh.sizeleft = strlen(testdata);
-
-  /* Fill in the file upload field */
-  if(oldstyle) {
-    formrc = curl_formadd(&formpost,
-                          &lastptr,
-                          CURLFORM_COPYNAME, "sendfile",
-                          CURLFORM_STREAM, &pooh,
-                          CURLFORM_CONTENTSLENGTH, (long)pooh.sizeleft,
-                          CURLFORM_FILENAME, "postit2.c",
-                          CURLFORM_END);
-  }
-  else {
-    /* new style */
-    formrc = curl_formadd(&formpost,
-                          &lastptr,
-                          CURLFORM_COPYNAME, "sendfile alternative",
-                          CURLFORM_STREAM, &pooh,
-                          CURLFORM_CONTENTLEN, (curl_off_t)pooh.sizeleft,
-                          CURLFORM_FILENAME, "file name 2",
-                          CURLFORM_END);
-  }
-
-  if(formrc)
-    curl_mprintf("curl_formadd(1) = %d\n", (int)formrc);
-
-  /* Now add the same data with another name and make it not look like
-     a file upload but still using the callback */
-
-  pooh2.readptr = testdata;
-  pooh2.sizeleft = strlen(testdata);
-
-  /* Fill in the file upload field */
-  formrc = curl_formadd(&formpost,
-                        &lastptr,
-                        CURLFORM_COPYNAME, "callbackdata",
-                        CURLFORM_STREAM, &pooh2,
-                        CURLFORM_CONTENTSLENGTH, (long)pooh2.sizeleft,
-                        CURLFORM_END);
-
-  if(formrc)
-    curl_mprintf("curl_formadd(2) = %d\n", (int)formrc);
-
-  /* Fill in the filename field */
-  formrc = curl_formadd(&formpost,
-                        &lastptr,
-                        CURLFORM_COPYNAME, "filename",
-                        CURLFORM_COPYCONTENTS, "postit2.c",
-                        CURLFORM_END);
-  if(formrc)
-    curl_mprintf("curl_formadd(3) = %d\n", (int)formrc);
-
-  /* Fill in a submit field too */
-  formrc = curl_formadd(&formpost,
-                        &lastptr,
-                        CURLFORM_COPYNAME, "submit",
-                        CURLFORM_COPYCONTENTS, "send",
-                        CURLFORM_CONTENTTYPE, "text/plain",
-                        CURLFORM_END);
-
-  if(formrc)
-    curl_mprintf("curl_formadd(4) = %d\n", (int)formrc);
-
-  formrc = curl_formadd(&formpost, &lastptr,
-                        CURLFORM_COPYNAME, "somename",
-                        CURLFORM_BUFFER, "somefile.txt",
-                        CURLFORM_BUFFERPTR, "blah blah",
-                        CURLFORM_BUFFERLENGTH, (long)9,
-                        CURLFORM_END);
-
-  if(formrc)
-    curl_mprintf("curl_formadd(5) = %d\n", (int)formrc);
-
-  curl = curl_easy_init();
-  if(!curl) {
-    curl_mfprintf(stderr, "curl_easy_init() failed\n");
-    curl_formfree(formpost);
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-
-  /* First set the URL that is about to receive our POST. */
-  test_setopt(curl, CURLOPT_URL, URL);
-
-  /* Now specify we want to POST data */
-  test_setopt(curl, CURLOPT_POST, 1L);
-
-  /* Set the expected POST size */
-  test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
-
-  /* we want to use our own read function */
-  test_setopt(curl, CURLOPT_READFUNCTION, t587_read_cb);
-
-  /* send a multi-part formpost */
-  test_setopt(curl, CURLOPT_HTTPPOST, formpost);
-
-  /* get verbose debug output please */
-  test_setopt(curl, CURLOPT_VERBOSE, 1L);
-
-  /* include headers in the output */
-  test_setopt(curl, CURLOPT_HEADER, 1L);
-
-  /* Perform the request, res will get the return code */
-  res = curl_easy_perform(curl);
-
-test_cleanup:
-
-  /* always cleanup */
-  curl_easy_cleanup(curl);
-
-  /* now cleanup the formpost chain */
-  curl_formfree(formpost);
-
-  return res;
-}
-
-CURLcode test(char *URL)
-{
-  CURLcode res;
-
-  if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
-    curl_mfprintf(stderr, "curl_global_init() failed\n");
-    return TEST_ERR_MAJOR_BAD;
-  }
-
-  res = t587_test_once(URL, TRUE); /* old */
-  if(!res)
-    res = t587_test_once(URL, FALSE); /* new */
-
-  curl_global_cleanup();
-
-  return res;
-}
index d2faa5f00dfb5653fe3d61262ca31ca173b71c30..a58f7041064106d43dc462532100bf43317f272c 100644 (file)
@@ -47,8 +47,7 @@ CURLcode test(char *URL)
   test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
   test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
 
-#ifdef LIB584
-  {
+  if(testnum == 584) {
     curl_mime *mime = curl_mime_init(curl);
     curl_mimepart *part = curl_mime_addpart(mime);
     curl_mime_name(part, "fake");
@@ -59,7 +58,6 @@ CURLcode test(char *URL)
     if(res)
       goto test_cleanup;
   }
-#endif
 
   test_setopt(curl, CURLOPT_MIMEPOST, NULL);
 
index 7181a28177f49e2e79806f9461359447cfbfa833..a3e8a714a97fa772578716eea80ef7e9d7a780ef 100644 (file)
@@ -38,9 +38,14 @@ static size_t t643_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
   if(size*nmemb < 1)
     return 0;
 
-  eof = pooh->sizeleft <= 0;
-  if(!eof)
-    pooh->sizeleft--;
+  if(testnum == 643) {
+    eof = pooh->sizeleft <= 0;
+    if(!eof)
+      pooh->sizeleft--;
+  }
+  else {
+    eof = !*pooh->readptr;
+  }
 
   if(!eof) {
     *ptr = *pooh->readptr;           /* copy one single byte */
@@ -65,7 +70,8 @@ static CURLcode t643_test_once(char *URL, bool oldstyle)
   curl_off_t datasize = -1;
 
   pooh.readptr = testdata;
-  datasize = (curl_off_t)strlen(testdata);
+  if(testnum == 643)
+    datasize = (curl_off_t)strlen(testdata);
   pooh.sizeleft = datasize;
 
   curl = curl_easy_init();
@@ -118,7 +124,8 @@ static CURLcode t643_test_once(char *URL, bool oldstyle)
      a file upload but still using the callback */
 
   pooh2.readptr = testdata;
-  datasize = (curl_off_t)strlen(testdata);
+  if(testnum == 643)
+    datasize = (curl_off_t)strlen(testdata);
   pooh2.sizeleft = datasize;
 
   part = curl_mime_addpart(mime);
diff --git a/tests/libtest/lib645.c b/tests/libtest/lib645.c
deleted file mode 100644 (file)
index 7e3196b..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/***************************************************************************
- *                                  _   _ ____  _
- *  Project                     ___| | | |  _ \| |
- *                             / __| | | | |_) | |
- *                            | (__| |_| |  _ <| |___
- *                             \___|\___/|_| \_\_____|
- *
- * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at https://curl.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * SPDX-License-Identifier: curl
- *
- ***************************************************************************/
-#include "test.h"
-
-#include "memdebug.h"
-
-struct t645_WriteThis {
-  const char *readptr;
-  curl_off_t sizeleft;
-};
-
-static size_t t645_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
-{
-  struct t645_WriteThis *pooh = (struct t645_WriteThis *)userp;
-  int eof;
-
-  if(size*nmemb < 1)
-    return 0;
-
-  eof = !*pooh->readptr;
-
-  if(!eof) {
-    *ptr = *pooh->readptr;           /* copy one single byte */
-    pooh->readptr++;                 /* advance pointer */
-    return 1;                        /* we return 1 byte at a time! */
-  }
-
-  return 0;                         /* no more data left to deliver */
-}
-
-static CURLcode t645_test_once(char *URL, bool oldstyle)
-{
-  static const char testdata[] = "dummy\n";
-
-  CURL *curl;
-  CURLcode res = CURLE_OK;
-
-  curl_mime *mime = NULL;
-  curl_mimepart *part = NULL;
-  struct t645_WriteThis pooh;
-  struct t645_WriteThis pooh2;
-  curl_off_t datasize = -1;
-
-  pooh.readptr = testdata;
-  pooh.sizeleft = datasize;
-
-  curl = curl_easy_init();
-  if(!curl) {
-    curl_mfprintf(stderr, "curl_easy_init() failed\n");
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-
-  mime = curl_mime_init(curl);
-  if(!mime) {
-    curl_mfprintf(stderr, "curl_mime_init() failed\n");
-    curl_easy_cleanup(curl);
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-
-  part = curl_mime_addpart(mime);
-  if(!part) {
-    curl_mfprintf(stderr, "curl_mime_addpart(1) failed\n");
-    curl_mime_free(mime);
-    curl_easy_cleanup(curl);
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-
-  /* Fill in the file upload part */
-  if(oldstyle) {
-    res = curl_mime_name(part, "sendfile");
-    if(!res)
-      res = curl_mime_data_cb(part, datasize, t645_read_cb,
-                              NULL, NULL, &pooh);
-    if(!res)
-      res = curl_mime_filename(part, "postit2.c");
-  }
-  else {
-    /* new style */
-    res = curl_mime_name(part, "sendfile alternative");
-    if(!res)
-      res = curl_mime_data_cb(part, datasize, t645_read_cb,
-                              NULL, NULL, &pooh);
-    if(!res)
-      res = curl_mime_filename(part, "file name 2");
-  }
-
-  if(res)
-    curl_mprintf("curl_mime_xxx(1) = %s\n", curl_easy_strerror(res));
-
-  /* Now add the same data with another name and make it not look like
-     a file upload but still using the callback */
-
-  pooh2.readptr = testdata;
-  pooh2.sizeleft = datasize;
-
-  part = curl_mime_addpart(mime);
-  if(!part) {
-    curl_mfprintf(stderr, "curl_mime_addpart(2) failed\n");
-    curl_mime_free(mime);
-    curl_easy_cleanup(curl);
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-  /* Fill in the file upload part */
-  res = curl_mime_name(part, "callbackdata");
-  if(!res)
-    res = curl_mime_data_cb(part, datasize, t645_read_cb,
-                            NULL, NULL, &pooh2);
-
-  if(res)
-    curl_mprintf("curl_mime_xxx(2) = %s\n", curl_easy_strerror(res));
-
-  part = curl_mime_addpart(mime);
-  if(!part) {
-    curl_mfprintf(stderr, "curl_mime_addpart(3) failed\n");
-    curl_mime_free(mime);
-    curl_easy_cleanup(curl);
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-
-  /* Fill in the filename field */
-  res = curl_mime_name(part, "filename");
-  if(!res)
-    res = curl_mime_data(part, "postit2.c",
-                         CURL_ZERO_TERMINATED);
-
-  if(res)
-    curl_mprintf("curl_mime_xxx(3) = %s\n", curl_easy_strerror(res));
-
-  /* Fill in a submit field too */
-  part = curl_mime_addpart(mime);
-  if(!part) {
-    curl_mfprintf(stderr, "curl_mime_addpart(4) failed\n");
-    curl_mime_free(mime);
-    curl_easy_cleanup(curl);
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-  res = curl_mime_name(part, "submit");
-  if(!res)
-    res = curl_mime_data(part, "send",
-                         CURL_ZERO_TERMINATED);
-
-  if(res)
-    curl_mprintf("curl_mime_xxx(4) = %s\n", curl_easy_strerror(res));
-
-  part = curl_mime_addpart(mime);
-  if(!part) {
-    curl_mfprintf(stderr, "curl_mime_addpart(5) failed\n");
-    curl_mime_free(mime);
-    curl_easy_cleanup(curl);
-    curl_global_cleanup();
-    return TEST_ERR_MAJOR_BAD;
-  }
-  res = curl_mime_name(part, "somename");
-  if(!res)
-    res = curl_mime_filename(part, "somefile.txt");
-  if(!res)
-    res = curl_mime_data(part, "blah blah", 9);
-
-  if(res)
-    curl_mprintf("curl_mime_xxx(5) = %s\n", curl_easy_strerror(res));
-
-  /* First set the URL that is about to receive our POST. */
-  test_setopt(curl, CURLOPT_URL, URL);
-
-  /* send a multi-part mimepost */
-  test_setopt(curl, CURLOPT_MIMEPOST, mime);
-
-  /* get verbose debug output please */
-  test_setopt(curl, CURLOPT_VERBOSE, 1L);
-
-  /* include headers in the output */
-  test_setopt(curl, CURLOPT_HEADER, 1L);
-
-  /* Perform the request, res will get the return code */
-  res = curl_easy_perform(curl);
-
-test_cleanup:
-
-  /* always cleanup */
-  curl_easy_cleanup(curl);
-
-  /* now cleanup the mimepost structure */
-  curl_mime_free(mime);
-
-  return res;
-}
-
-static CURLcode t645_cyclic_add(void)
-{
-  CURL *easy = curl_easy_init();
-  curl_mime *mime = curl_mime_init(easy);
-  curl_mimepart *part = curl_mime_addpart(mime);
-  CURLcode a1 = curl_mime_subparts(part, mime);
-
-  if(a1 == CURLE_BAD_FUNCTION_ARGUMENT) {
-    curl_mime *submime = curl_mime_init(easy);
-    curl_mimepart *subpart = curl_mime_addpart(submime);
-
-    curl_mime_subparts(part, submime);
-    a1 = curl_mime_subparts(subpart, mime);
-  }
-
-  curl_mime_free(mime);
-  curl_easy_cleanup(easy);
-  if(a1 != CURLE_BAD_FUNCTION_ARGUMENT)
-    /* that should have failed */
-    return TEST_ERR_FAILURE;
-
-  return CURLE_OK;
-}
-
-CURLcode test(char *URL)
-{
-  CURLcode res;
-
-  if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
-    curl_mfprintf(stderr, "curl_global_init() failed\n");
-    return TEST_ERR_MAJOR_BAD;
-  }
-
-  res = t645_test_once(URL, TRUE); /* old */
-  if(!res)
-    res = t645_test_once(URL, FALSE); /* new */
-
-  if(!res)
-    res = t645_cyclic_add();
-
-  curl_global_cleanup();
-
-  return res;
-}
index 4a64e7831fd5e31ead3949996da3bb182019edda..051142a48824eb6d1c2404fc1e3606b5a171b373 100644 (file)
@@ -29,8 +29,6 @@
 
 #define PAUSE_TIME      5
 
-#ifndef LIB670_C
-#define LIB670_C
 struct t670_ReadThis {
   CURL *easy;
   time_t origin;
@@ -62,11 +60,7 @@ static size_t t670_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
   curl_mfprintf(stderr, "Read callback called after EOF\n");
   exit(1);
 }
-#endif
 
-#if !defined(LIB670) && !defined(LIB672)
-#ifndef LIB670_XFERINFO_C
-#define LIB670_XFERINFO_C
 static int t670_xferinfo(void *clientp,
                          curl_off_t dltotal, curl_off_t dlnow,
                          curl_off_t ultotal, curl_off_t ulnow)
@@ -92,28 +86,13 @@ static int t670_xferinfo(void *clientp,
 
   return 0;
 }
-#endif
-#endif
 
 CURLcode test(char *URL)
 {
   static const char testname[] = "field";
 
-#if defined(LIB670) || defined(LIB671)
   curl_mime *mime = NULL;
-  curl_mimepart *part;
-#else
-  CURLFORMcode formrc;
   struct curl_httppost *formpost = NULL;
-  struct curl_httppost *lastptr = NULL;
-#endif
-#if defined(LIB670) || defined(LIB672)
-  CURLM *multi = NULL;
-  CURLMcode mres;
-  CURLMsg *msg;
-  int msgs_left;
-  int still_running = 0;
-#endif
 
   struct t670_ReadThis pooh;
   CURLcode res = TEST_ERR_FAILURE;
@@ -140,121 +119,131 @@ CURLcode test(char *URL)
   /* include headers in the output */
   test_setopt(pooh.easy, CURLOPT_HEADER, 1L);
 
-#if defined(LIB670) || defined(LIB671)
-  /* Build the mime tree. */
-  mime = curl_mime_init(pooh.easy);
-  part = curl_mime_addpart(mime);
-  res = curl_mime_name(part, testname);
-  if(res != CURLE_OK) {
-    curl_mfprintf(stderr,
-            "Something went wrong when building the mime structure: %d\n",
-            res);
-    goto test_cleanup;
-  }
+  if(testnum == 670 || testnum == 671) {
+    curl_mimepart *part;
+    /* Build the mime tree. */
+    mime = curl_mime_init(pooh.easy);
+    part = curl_mime_addpart(mime);
+    res = curl_mime_name(part, testname);
+    if(res != CURLE_OK) {
+      curl_mfprintf(stderr,
+              "Something went wrong when building the mime structure: %d\n",
+              res);
+      goto test_cleanup;
+    }
+
+    res = curl_mime_data_cb(part, (curl_off_t) 2, t670_read_cb,
+                            NULL, NULL, &pooh);
 
-  res = curl_mime_data_cb(part, (curl_off_t) 2, t670_read_cb,
-                          NULL, NULL, &pooh);
-
-  /* Bind mime data to its easy handle. */
-  if(res == CURLE_OK)
-    test_setopt(pooh.easy, CURLOPT_MIMEPOST, mime);
-#else
-  /* Build the form. */
-  formrc = curl_formadd(&formpost, &lastptr,
-                        CURLFORM_COPYNAME, testname,
-                        CURLFORM_STREAM, &pooh,
-                        CURLFORM_CONTENTLEN, (curl_off_t) 2,
-                        CURLFORM_END);
-  if(formrc) {
-    curl_mfprintf(stderr, "curl_formadd() = %d\n", (int) formrc);
-    goto test_cleanup;
+    /* Bind mime data to its easy handle. */
+    if(res == CURLE_OK)
+      test_setopt(pooh.easy, CURLOPT_MIMEPOST, mime);
   }
+  else {
+    struct curl_httppost *lastptr = NULL;
+    CURLFORMcode formrc;
+    /* Build the form. */
+    formrc = curl_formadd(&formpost, &lastptr,
+                          CURLFORM_COPYNAME, testname,
+                          CURLFORM_STREAM, &pooh,
+                          CURLFORM_CONTENTLEN, (curl_off_t) 2,
+                          CURLFORM_END);
+    if(formrc) {
+      curl_mfprintf(stderr, "curl_formadd() = %d\n", (int) formrc);
+      goto test_cleanup;
+    }
 
-  /* We want to use our own read function. */
-  test_setopt(pooh.easy, CURLOPT_READFUNCTION, t670_read_cb);
+    /* We want to use our own read function. */
+    test_setopt(pooh.easy, CURLOPT_READFUNCTION, t670_read_cb);
 
-  /* Send a multi-part formpost. */
-  test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost);
-#endif
+    /* Send a multi-part formpost. */
+    test_setopt(pooh.easy, CURLOPT_HTTPPOST, formpost);
+  }
 
-#if defined(LIB670) || defined(LIB672)
-  /* Use the multi interface. */
-  multi = curl_multi_init();
-  mres = curl_multi_add_handle(multi, pooh.easy);
-  while(!mres) {
-    struct timeval timeout;
-    int rc = 0;
-    fd_set fdread;
-    fd_set fdwrite;
-    fd_set fdexcept;
-    int maxfd = -1;
-
-    mres = curl_multi_perform(multi, &still_running);
-    if(!still_running || mres != CURLM_OK)
-      break;
-
-    if(pooh.origin) {
-      time_t delta = time(NULL) - pooh.origin;
-
-      if(delta >= 4 * PAUSE_TIME) {
-        curl_mfprintf(stderr, "unpausing failed: drain problem?\n");
-        res = CURLE_OPERATION_TIMEDOUT;
+  if(testnum == 670 || testnum == 672) {
+    CURLMcode mres;
+    CURLM *multi;
+    /* Use the multi interface. */
+    multi = curl_multi_init();
+    mres = curl_multi_add_handle(multi, pooh.easy);
+    while(!mres) {
+      struct timeval timeout;
+      int rc = 0;
+      fd_set fdread;
+      fd_set fdwrite;
+      fd_set fdexcept;
+      int maxfd = -1;
+      int still_running = 0;
+
+      mres = curl_multi_perform(multi, &still_running);
+      if(!still_running || mres != CURLM_OK)
         break;
-      }
 
-      if(delta >= PAUSE_TIME)
-        curl_easy_pause(pooh.easy, CURLPAUSE_CONT);
-    }
+      if(pooh.origin) {
+        time_t delta = time(NULL) - pooh.origin;
+
+        if(delta >= 4 * PAUSE_TIME) {
+          curl_mfprintf(stderr, "unpausing failed: drain problem?\n");
+          res = CURLE_OPERATION_TIMEDOUT;
+          break;
+        }
 
-    FD_ZERO(&fdread);
-    FD_ZERO(&fdwrite);
-    FD_ZERO(&fdexcept);
-    timeout.tv_sec = 0;
-    timeout.tv_usec = 1000000 * PAUSE_TIME / 10;
-    mres = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcept, &maxfd);
-    if(mres)
-      break;
+        if(delta >= PAUSE_TIME)
+          curl_easy_pause(pooh.easy, CURLPAUSE_CONT);
+      }
+
+      FD_ZERO(&fdread);
+      FD_ZERO(&fdwrite);
+      FD_ZERO(&fdexcept);
+      timeout.tv_sec = 0;
+      timeout.tv_usec = 1000000 * PAUSE_TIME / 10;
+      mres = curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcept, &maxfd);
+      if(mres)
+        break;
 #ifdef _WIN32
-    if(maxfd == -1)
-      Sleep(100);
-    else
+      if(maxfd == -1)
+        Sleep(100);
+      else
 #endif
-    rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcept, &timeout);
-    if(rc == -1) {
-      curl_mfprintf(stderr, "Select error\n");
-      break;
-    }
-  }
-
-  if(mres != CURLM_OK)
-    for(;;) {
-      msg = curl_multi_info_read(multi, &msgs_left);
-      if(!msg)
+      rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcept, &timeout);
+      if(rc == -1) {
+        curl_mfprintf(stderr, "Select error\n");
         break;
-      if(msg->msg == CURLMSG_DONE) {
-        res = msg->data.result;
       }
     }
 
-  curl_multi_remove_handle(multi, pooh.easy);
-  curl_multi_cleanup(multi);
-
-#else
-  /* Use the easy interface. */
-  test_setopt(pooh.easy, CURLOPT_XFERINFODATA, &pooh);
-  test_setopt(pooh.easy, CURLOPT_XFERINFOFUNCTION, t670_xferinfo);
-  test_setopt(pooh.easy, CURLOPT_NOPROGRESS, 0L);
-  res = curl_easy_perform(pooh.easy);
-#endif
+    if(mres != CURLM_OK)
+      for(;;) {
+        int msgs_left;
+        CURLMsg *msg;
+        msg = curl_multi_info_read(multi, &msgs_left);
+        if(!msg)
+          break;
+        if(msg->msg == CURLMSG_DONE) {
+          res = msg->data.result;
+        }
+      }
 
+    curl_multi_remove_handle(multi, pooh.easy);
+    curl_multi_cleanup(multi);
+  }
+  else {
+    /* Use the easy interface. */
+    test_setopt(pooh.easy, CURLOPT_XFERINFODATA, &pooh);
+    test_setopt(pooh.easy, CURLOPT_XFERINFOFUNCTION, t670_xferinfo);
+    test_setopt(pooh.easy, CURLOPT_NOPROGRESS, 0L);
+    res = curl_easy_perform(pooh.easy);
+  }
 
 test_cleanup:
   curl_easy_cleanup(pooh.easy);
-#if defined(LIB670) || defined(LIB671)
-  curl_mime_free(mime);
-#else
-  curl_formfree(formpost);
-#endif
+
+  if(testnum == 670 || testnum == 671) {
+    curl_mime_free(mime);
+  }
+  else {
+    curl_formfree(formpost);
+  }
 
   curl_global_cleanup();
   return res;
index 0a29d287bb01ee85bc3b9fb01659a902c13e01b9..ff4c7ad1ae541fb14b297bf1a92baa1cb864724b 100755 (executable)
@@ -53,7 +53,6 @@ while(my $line = <$fh>) {
     chomp $line;
     if($line =~ /([a-z0-9]+)_SOURCES\ =\ ([a-z0-9]+)\.c/) {
         my $name = $1;
-        my $namu = uc($name);
         my $src = "$2.c";
 
         # Make common symbols unique across test sources
@@ -62,9 +61,7 @@ while(my $line = <$fh>) {
             print "#define $symb ${symb}_$name\n";
         }
 
-        print "#define $namu\n";
         print "#include \"$src\"\n";
-        print "#undef $namu\n";
         print "\n";
         $tlist .= "  {\"$name\", test_$name},\n";
     }