]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Better error handling in the remote backend tests 12210/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 18 Nov 2022 09:04:30 +0000 (10:04 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 18 Nov 2022 09:04:30 +0000 (10:04 +0100)
modules/remotebackend/test-remotebackend.cc

index 021248eb395ed60b0fb31374befbf6f352fc6378..443713cc8d643f55b24546c136555f768b17002b 100644 (file)
@@ -255,7 +255,8 @@ BOOST_AUTO_TEST_CASE(test_method_getAllDomains)
 
   be->getAllDomains(&result, true, true);
 
-  di = result[0];
+  BOOST_REQUIRE(!result.empty());
+  di = result.at(0);
   BOOST_CHECK_EQUAL(di.zone.toString(), "unit.test.");
   BOOST_CHECK_EQUAL(di.serial, 2);
   BOOST_CHECK_EQUAL(di.notified_serial, 2);
@@ -375,9 +376,9 @@ BOOST_AUTO_TEST_CASE(test_method_getUpdatedMasters)
 
   be->getUpdatedMasters(result, catalogs, hashes);
 
-  BOOST_CHECK(result.size() > 0);
+  BOOST_REQUIRE(result.size() > 0);
 
-  di = result[0];
+  di = result.at(0);
   BOOST_CHECK_EQUAL(di.zone.toString(), "master.test.");
   BOOST_CHECK_EQUAL(di.serial, 2);
   BOOST_CHECK_EQUAL(di.notified_serial, 2);