diff options
author | Marc van der Wal <marc.vanderwal@afnic.fr> | 2022-09-05 07:45:07 +0200 |
---|---|---|
committer | Marc van der Wal <marc.vanderwal@afnic.fr> | 2022-09-05 07:45:07 +0200 |
commit | 65a7ce9e5d5faba1926b25bb2f173951b55fcd08 (patch) | |
tree | 42330e5e938693121ccbceae3eddf4c46a13c06d /t | |
parent | deec8e9cfa8abecceb1497d30c69b9ea0d4fde38 (diff) |
Fix “bad CAA” unit tests on single-threaded Perl
Instantiation of a malformed CAA resource record is a guaranteed croak
if and only if the Perl in use is compiled with support for interpreter
threads (-DUSE_ITHREADS). If not, it won’t. So the unit test is modified
to try to convert the bad CAA record back to presentation form, so that
it does become a guaranteed croak.
Diffstat (limited to 't')
-rw-r--r-- | t/rr.t | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -228,8 +228,11 @@ subtest 'SPF' => sub { subtest 'croak when given malformed CAA records' => sub { my $will_croak = sub { - Zonemaster::LDNS::RR->new( - 'bad-caa.example. 3600 IN CAA \# 4 C0000202' ) + # This will croak if LDNS.xs is compiled with -DUSE_ITHREADS + my $bad_caa = Zonemaster::LDNS::RR->new( + 'bad-caa.example. 3600 IN CAA \# 4 C0000202' ); + # This will always croak + $bad_caa->string(); }; like( exception { $will_croak->() }, qr/^Failed to convert RR to string/ ); }; |