From eb9600f749c68ccb436ce43f292b31ab0b61ba6d Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Mon, 30 Dec 2024 01:13:09 +0100 Subject: [PATCH] Remove some more redundant old-style tests. --- test/Makefile.am | 3 --- test/Makefile.in | 27 +++++---------------- test/test78.cxx | 44 ---------------------------------- test/test79.cxx | 49 -------------------------------------- test/test87.cxx | 62 ------------------------------------------------ 5 files changed, 6 insertions(+), 179 deletions(-) delete mode 100644 test/test78.cxx delete mode 100644 test/test79.cxx delete mode 100644 test/test87.cxx diff --git a/test/Makefile.am b/test/Makefile.am index aee6936b2..67280a457 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -69,11 +69,8 @@ runner_SOURCES = \ test75.cxx \ test76.cxx \ test77.cxx \ - test78.cxx \ - test79.cxx \ test82.cxx \ test84.cxx \ - test87.cxx \ test88.cxx \ test89.cxx \ test90.cxx \ diff --git a/test/Makefile.in b/test/Makefile.in index 678b6a532..9a3c5521d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -135,9 +135,8 @@ am_runner_OBJECTS = test00.$(OBJEXT) test01.$(OBJEXT) test02.$(OBJEXT) \ test60.$(OBJEXT) test61.$(OBJEXT) test62.$(OBJEXT) \ test69.$(OBJEXT) test70.$(OBJEXT) test71.$(OBJEXT) \ test72.$(OBJEXT) test74.$(OBJEXT) test75.$(OBJEXT) \ - test76.$(OBJEXT) test77.$(OBJEXT) test78.$(OBJEXT) \ - test79.$(OBJEXT) test82.$(OBJEXT) test84.$(OBJEXT) \ - test87.$(OBJEXT) test88.$(OBJEXT) test89.$(OBJEXT) \ + test76.$(OBJEXT) test77.$(OBJEXT) test82.$(OBJEXT) \ + test84.$(OBJEXT) test88.$(OBJEXT) test89.$(OBJEXT) \ test90.$(OBJEXT) unit/test_array.$(OBJEXT) \ unit/test_blob.$(OBJEXT) unit/test_cancel_query.$(OBJEXT) \ unit/test_column.$(OBJEXT) unit/test_composite.$(OBJEXT) \ @@ -204,12 +203,10 @@ am__depfiles_remade = ./$(DEPDIR)/runner.Po ./$(DEPDIR)/test00.Po \ ./$(DEPDIR)/test70.Po ./$(DEPDIR)/test71.Po \ ./$(DEPDIR)/test72.Po ./$(DEPDIR)/test74.Po \ ./$(DEPDIR)/test75.Po ./$(DEPDIR)/test76.Po \ - ./$(DEPDIR)/test77.Po ./$(DEPDIR)/test78.Po \ - ./$(DEPDIR)/test79.Po ./$(DEPDIR)/test82.Po \ - ./$(DEPDIR)/test84.Po ./$(DEPDIR)/test87.Po \ - ./$(DEPDIR)/test88.Po ./$(DEPDIR)/test89.Po \ - ./$(DEPDIR)/test90.Po unit/$(DEPDIR)/test_array.Po \ - unit/$(DEPDIR)/test_blob.Po \ + ./$(DEPDIR)/test77.Po ./$(DEPDIR)/test82.Po \ + ./$(DEPDIR)/test84.Po ./$(DEPDIR)/test88.Po \ + ./$(DEPDIR)/test89.Po ./$(DEPDIR)/test90.Po \ + unit/$(DEPDIR)/test_array.Po unit/$(DEPDIR)/test_blob.Po \ unit/$(DEPDIR)/test_cancel_query.Po \ unit/$(DEPDIR)/test_column.Po unit/$(DEPDIR)/test_composite.Po \ unit/$(DEPDIR)/test_connection.Po \ @@ -497,11 +494,8 @@ runner_SOURCES = \ test75.cxx \ test76.cxx \ test77.cxx \ - test78.cxx \ - test79.cxx \ test82.cxx \ test84.cxx \ - test87.cxx \ test88.cxx \ test89.cxx \ test90.cxx \ @@ -730,11 +724,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test75.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test76.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test77.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test78.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test79.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test82.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test84.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test87.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test88.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test89.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test90.Po@am__quote@ # am--include-marker @@ -1074,11 +1065,8 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/test75.Po -rm -f ./$(DEPDIR)/test76.Po -rm -f ./$(DEPDIR)/test77.Po - -rm -f ./$(DEPDIR)/test78.Po - -rm -f ./$(DEPDIR)/test79.Po -rm -f ./$(DEPDIR)/test82.Po -rm -f ./$(DEPDIR)/test84.Po - -rm -f ./$(DEPDIR)/test87.Po -rm -f ./$(DEPDIR)/test88.Po -rm -f ./$(DEPDIR)/test89.Po -rm -f ./$(DEPDIR)/test90.Po @@ -1203,11 +1191,8 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/test75.Po -rm -f ./$(DEPDIR)/test76.Po -rm -f ./$(DEPDIR)/test77.Po - -rm -f ./$(DEPDIR)/test78.Po - -rm -f ./$(DEPDIR)/test79.Po -rm -f ./$(DEPDIR)/test82.Po -rm -f ./$(DEPDIR)/test84.Po - -rm -f ./$(DEPDIR)/test87.Po -rm -f ./$(DEPDIR)/test88.Po -rm -f ./$(DEPDIR)/test89.Po -rm -f ./$(DEPDIR)/test90.Po diff --git a/test/test78.cxx b/test/test78.cxx deleted file mode 100644 index 2ef1732be..000000000 --- a/test/test78.cxx +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include -#include - -#include -#include - -#include "test_helpers.hxx" - - -// Example program for libpqxx. Send notification to self, using a -// notification name with unusal characters, and without polling. -namespace -{ -void test_078() -{ - pqxx::connection cx; - bool done{false}; - - std::string const channel{"my listener"}; - cx.listen(channel, [&done](pqxx::notification) noexcept { done = true; }); - - pqxx::perform([&cx, &channel] { - pqxx::nontransaction tx{cx}; - tx.notify(channel); - tx.commit(); - }); - - int notifs{0}; - for (int i{0}; (i < 20) and not done; ++i) - { - PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notifications."); - std::cout << "."; - notifs = cx.await_notification(); - } - std::cout << std::endl; - - PQXX_CHECK(done, "No notification received."); - PQXX_CHECK_EQUAL(notifs, 1, "Got unexpected number of notifications."); -} -} // namespace - - -PQXX_REGISTER_TEST(test_078); diff --git a/test/test79.cxx b/test/test79.cxx deleted file mode 100644 index 764114840..000000000 --- a/test/test79.cxx +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include -#include - -#include -#include - -#include "test_helpers.hxx" - - -// Example program for libpqxx. Test waiting for notification with timeout. -namespace -{ -void test_079() -{ - pqxx::connection cx; - - std::string const channel{"mylistener"}; - int backend_pid{0}; - - cx.listen(channel, [&backend_pid](pqxx::notification n) noexcept { - backend_pid = n.backend_pid; - }); - - // First see if the timeout really works: we're not expecting any notifs - int notifs{cx.await_notification(0, 1)}; - PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notification."); - - pqxx::perform([&cx, &channel] { - pqxx::work tx{cx}; - tx.notify(channel); - tx.commit(); - }); - - for (int i{0}; (i < 20) and (backend_pid == 0); ++i) - { - PQXX_CHECK_EQUAL(notifs, 0, "Got notifications, but no handler called."); - std::cout << "."; - notifs = cx.await_notification(1, 0); - } - std::cout << std::endl; - - PQXX_CHECK_EQUAL(backend_pid, cx.backendpid(), "Wrong backend."); - PQXX_CHECK_EQUAL(notifs, 1, "Got unexpected notifications."); -} -} // namespace - - -PQXX_REGISTER_TEST(test_079); diff --git a/test/test87.cxx b/test/test87.cxx deleted file mode 100644 index 628f2cbd4..000000000 --- a/test/test87.cxx +++ /dev/null @@ -1,62 +0,0 @@ -#include "pqxx/config-public-compiler.h" -#include -#include -#include -#include -#include - -#include - -#include - -#include - -#include -#include - -#include "test_helpers.hxx" - - -// Test program for libpqxx. Send notification to self, and wait on the -// socket's connection for it to come in. In a simple situation you'd use -// connection::await_notification() for this, but that won't let you wait for -// multiple sockets. -namespace -{ -void test_087() -{ - pqxx::connection cx; - - std::string const channel{"my notification"}; - int backend_pid{0}; - - cx.listen(channel, [&backend_pid](pqxx::notification n) noexcept { - backend_pid = n.backend_pid; - }); - - pqxx::perform([&cx, &channel] { - pqxx::work tx{cx}; - tx.notify(channel); - tx.commit(); - }); - - int notifs{0}; - for (int i{0}; (i < 20) and (backend_pid == 0); ++i) - { - PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notifications."); - - std::cout << "."; - - pqxx::internal::wait_fd(cx.sock(), true, false); - notifs = cx.get_notifs(); - } - std::cout << std::endl; - - PQXX_CHECK_EQUAL( - backend_pid, cx.backendpid(), "Notification came from wrong backend."); - PQXX_CHECK_EQUAL(notifs, 1, "Got unexpected number of notifications."); -} -} // namespace - - -PQXX_REGISTER_TEST(test_087);