tag 546221 + patch thanks Hi Niko and hi Serge
I picked a patch from upstream's svn and now libxray-absorption-perl builds fine. The patch is attached. I can prepare a NMU if Serge agrees and have not mucht time. Please let me know. Bests Salvatore
Description: Use Test::More and prevent FTBFS with newer Test::Harness Origin: upstream (diff -r51:52). Bug-Debian: http://bugs.debian.org/546221 Forwarded: no --- a/t/elam.t +++ b/t/elam.t @@ -1,105 +1,30 @@ #! /usr/bin/perl -w -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' -######################### We start with some black magic to print on failure. - -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) +#! /usr/bin/perl -w -BEGIN { $| = 1; print "1..15$/"; } -END {print "not ok 1$/" unless $loaded;} +use Test::More tests => 14; use Xray::Absorption; -$loaded = 1; -print "ok 1$/"; - -######################### End of black magic. -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): - -$i=1; -$epsilon = 0.0001; +my $epsilon = 0.0001; Xray::Absorption -> load("elam"); -#print Xray::Absorption -> current_resource, $/; -if (Xray::Absorption -> current_resource =~ /elam/i) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - -if (Xray::Absorption -> in_resource("dy")) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; +ok( Xray::Absorption -> current_resource =~ m{elam}i, "loaded resource"); +ok( Xray::Absorption -> in_resource("dy"), "found element Dy"); ## fetch material properties -if (abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon, "atomic weight"); +ok( abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon, "density"); +ok( abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon, "conversion"); ## fetch edge energies -if (abs(Xray::Absorption -> get_energy("dy", "k") - 53789) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l1") - 9046) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l2") - 8581) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l3") - 7790) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "m1") - 2047) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_energy("dy", "k") - 53789) < $epsilon, "K edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l1") - 9046) < $epsilon, "L1 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l2") - 8581) < $epsilon, "L2 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l3") - 7790) < $epsilon, "L3 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "m1") - 2047) < $epsilon, "M1 edge"); ## fetch fluorescence lines -if (abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45772.309978) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "kbeta") - 52166.8201163) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6494.569735) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7354.310914) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; +ok( abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45772.309978 ) < $epsilon, "Kalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "kbeta" ) - 52166.8201163 ) < $epsilon, "Kbeta"); +ok( abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6494.569735) < $epsilon, "Lalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7354.310914) < $epsilon, "Lbeta"); --- a/t/chantler.t +++ b/t/chantler.t @@ -1,105 +1,28 @@ #! /usr/bin/perl -w -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' -######################### We start with some black magic to print on failure. - -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) - -BEGIN { $| = 1; print "1..15$/"; } -END {print "not ok 1$/" unless $loaded;} +use Test::More tests => 14; use Xray::Absorption; -$loaded = 1; -print "ok 1$/"; - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): -$i=1; -$epsilon = 0.0001; +my $epsilon = 0.0001; Xray::Absorption -> load("chantler"); -if (Xray::Absorption -> current_resource =~ /chantler/i) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - -if (Xray::Absorption -> in_resource("dy")) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( Xray::Absorption -> current_resource =~ m{chantler}i, "loaded resource"); +ok( Xray::Absorption -> in_resource("dy"), "found element Dy"); ## fetch material properties -if (abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon, "atomic weight"); +ok( abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon, "density"); +ok( abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon, "conversion"); ## fetch edge energies -if (abs(Xray::Absorption -> get_energy("dy", "k") - 53788.5) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l1") - 9045.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l2") - 8580.6) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l3") - 7790.1) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "m1") - 2046.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_energy("dy", "k") - 53788.5) < $epsilon, "K edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l1") - 9045.8) < $epsilon, "L1 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l2") - 8580.6) < $epsilon, "L2 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l3") - 7790.1) < $epsilon, "L3 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "m1") - 2046.8) < $epsilon, "M1 edge"); ## fetch fluorescence lines -if (abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45985) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "kbeta") - 52178) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6495.2) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7247.7) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; +ok( abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45985 ) < $epsilon, "Kalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "kbeta" ) - 52178 ) < $epsilon, "Kbeta"); +ok( abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6495.2) < $epsilon, "Lalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7247.7) < $epsilon, "Lbeta"); --- a/t/shaltout.t +++ b/t/shaltout.t @@ -1,90 +1,24 @@ #! /usr/bin/perl -w -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' -######################### We start with some black magic to print on failure. - -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) +#! /usr/bin/perl -w -BEGIN { $| = 1; print "1..11$/"; } -END {print "not ok 1$/" unless $loaded;} +use Test::More tests => 10; use Xray::Absorption; -$loaded = 1; -$i=0; -print "ok ", $i++, $/; - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): -$epsilon = 0.0001; +my $epsilon = 0.0001; Xray::Absorption -> load("shaltout"); - -if (Xray::Absorption -> current_resource =~ /shaltout/i) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - -if (Xray::Absorption -> in_resource("dy")) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( Xray::Absorption -> current_resource =~ m{shaltout}i, "loaded resource"); +ok( Xray::Absorption -> in_resource("dy"), "found element Dy"); ## fetch material properties -if (abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon, "atomic weight"); +ok( abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon, "density"); +ok( abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon, "conversion"); ## fetch edge energies -if (abs(Xray::Absorption -> get_energy("dy", "k") - 53789) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l1") - 9047) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l2") - 8581) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l3") - 7790) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "m1") - 2046) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - -# if (Xray::Absorption -> data_available("dy", "l3")) { -# print "Dy L3 exists\n"; -# } else { -# print "Dy L3 does not exist\n"; -# }; -##print ">> ", join("|", Xray::Absorption -> next_energy("fe", "k", "ho", "er", "fe", "o")), $/; +ok( abs(Xray::Absorption -> get_energy("dy", "k") - 53789) < $epsilon, "K edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l1") - 9047) < $epsilon, "L1 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l2") - 8581) < $epsilon, "L2 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l3") - 7790) < $epsilon, "L3 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "m1") - 2046) < $epsilon, "M1 edge"); --- a/t/fluo.t +++ b/t/fluo.t @@ -1,34 +1,13 @@ #!/usr/bin/perl -w +use Test::More tests => 4; use Xray::FluorescenceEXAFS; -BEGIN { $| = 1; print "1..5$/"; } -END {print "not ok 1$/" unless $loaded;} -$loaded = 1; -$i = 0; -print "ok ", ++$i, $/; my $contents = {Y=>1, Ba=>2, Cu=>3, O=>7}; -if (abs(0.000463 - Xray::FluorescenceEXAFS->mcmaster("Cu", "K")) < .00001) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - -if (abs(0.0006166 - Xray::FluorescenceEXAFS->i0("Cu", "K", {nitrogen=>0.5})) < 0.000001) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; +ok( abs(0.000463 - Xray::FluorescenceEXAFS->mcmaster("Cu", "K")) < .00001, "mcmaster correction"); +ok( abs(0.0006166 - Xray::FluorescenceEXAFS->i0("Cu", "K", {nitrogen=>0.5})) < 0.000001, "i0 correction"); my @list = Xray::FluorescenceEXAFS->self("Cu", "K", $contents); -if (abs(1.28 - $list[0]) < 0.01) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(0.0000573 - $list[1]) < 0.00001) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; +ok( abs(1.28 - $list[0]) < 0.01, "self absorption, amplitude"); +ok( abs(0.0000573 - $list[1]) < 0.00001, "self absorption, sigma^2"); --- a/t/henke.t +++ b/t/henke.t @@ -1,105 +1,30 @@ #! /usr/bin/perl -w -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' -######################### We start with some black magic to print on failure. - -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) +#! /usr/bin/perl -w -BEGIN { $| = 1; print "1..15$/"; } -END {print "not ok 1$/" unless $loaded;} +use Test::More tests => 14; use Xray::Absorption; -$loaded = 1; -print "ok 1$/"; - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): -$i=1; -$epsilon = 0.0001; +my $epsilon = 0.0001; Xray::Absorption -> load("henke"); -if (Xray::Absorption -> current_resource =~ /henke/i) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - -if (Xray::Absorption -> in_resource("dy")) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( Xray::Absorption -> current_resource =~ m{henke}i, "loaded resource"); +ok( Xray::Absorption -> in_resource("dy"), "found element Dy"); ## fetch material properties -if (abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon, "atomic weight"); +ok( abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon, "density"); +ok( abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon, "conversion"); ## fetch edge energies -if (abs(Xray::Absorption -> get_energy("dy", "k") - 53788.5) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l1") - 9045.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l2") - 8580.6) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l3") - 7790.1) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "m1") - 2046.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_energy("dy", "k") - 53788.5) < $epsilon, "K edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l1") - 9045.8) < $epsilon, "L1 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l2") - 8580.6) < $epsilon, "L2 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l3") - 7790.1) < $epsilon, "L3 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "m1") - 2046.8) < $epsilon, "M1 edge"); ## fetch fluorescence lines -if (abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45985) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "kbeta") - 52178) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6495.2) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7247.7) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; +ok( abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45985 ) < $epsilon, "Kalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "kbeta" ) - 52178 ) < $epsilon, "Kbeta"); +ok( abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6495.2) < $epsilon, "Lalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7247.7) < $epsilon, "Lbeta"); --- a/t/mcmaster.t +++ b/t/mcmaster.t @@ -1,144 +1,30 @@ #! /usr/bin/perl -w -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' -######################### We start with some black magic to print on failure. - -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) +#! /usr/bin/perl -w -BEGIN { $| = 1; print "1..15$/"; } -END {print "not ok 1$/" unless $loaded;} +use Test::More tests => 14; use Xray::Absorption; -$loaded = 1; -print "ok 1$/"; - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): -$i=1; -$epsilon = 0.0001; +my $epsilon = 0.0001; Xray::Absorption -> load("mcmaster"); -if (Xray::Absorption -> current_resource =~ /mcmaster/i) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - -if (Xray::Absorption -> in_resource("dy")) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( Xray::Absorption -> current_resource =~ m{mcmaster}i, "loaded resource"); +ok( Xray::Absorption -> in_resource("dy"), "found element Dy"); ## fetch material properties -if (abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_atomic_weight("dy") - 162.510) < $epsilon, "atomic weight"); +ok( abs(Xray::Absorption -> get_density("dy") - 8.536) < $epsilon, "density"); +ok( abs(Xray::Absorption -> get_conversion("dy") - 269.8) < $epsilon, "conversion"); ## fetch edge energies -if (abs(Xray::Absorption -> get_energy("dy", "k") - 53789) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l1") - 9047) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l2") - 8581) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "l3") - 7790) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "m1") - 2046) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - +ok( abs(Xray::Absorption -> get_energy("dy", "k") - 53789) < $epsilon, "K edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l1") - 9047) < $epsilon, "L1 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l2") - 8581) < $epsilon, "L2 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "l3") - 7790) < $epsilon, "L3 edge"); +ok( abs(Xray::Absorption -> get_energy("dy", "m1") - 2046) < $epsilon, "M1 edge"); ## fetch fluorescence lines -if (abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45985) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "kbeta") - 52178) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6495.2) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; -if (abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7247.7) < $epsilon ) { - print "ok ", ++$i, $/ -} else { - print "not ok ", ++$i, $/ -}; - - -## 'a_k' => [ -## '0.114845e+02', -## ' 0.210451e+01', -## ' -0.989870e+00', -## ' 0.669382e-01' -## ], -## 'a_l' => [ -## '0.173446e+02', -## ' -0.254821e+01', -## ' -0.317606e-01', -## ' 0.000000e+00' -## ], -## 'a_m' => [ -## '0.159225e+02', -## ' -0.265289e+01', -## ' 0.000000e+00', -## ' 0.000000e+00' -## ], -## 'a_n' => [ -## '0.159225e+02', -## ' -0.265289e+01', -## ' 0.000000e+00', -## ' 0.000000e+00' -## ], -## 'incoherent' => [ -## '0.242685e+00', -## ' 0.146266e+01', -## ' -0.189102e+00', -## ' 0.385628e-02' -## ], -## 'coherent' => [ -## '0.774188e+01', -## ' 0.367107e+00', -## ' -0.349433e+00', -## ' 0.166273e-01' -## ], -## 'ljump_3' => ' 0.904700e+01' +ok( abs(Xray::Absorption -> get_energy("dy", "kalpha") - 45985 ) < $epsilon, "Kalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "kbeta" ) - 52178 ) < $epsilon, "Kbeta"); +ok( abs(Xray::Absorption -> get_energy("dy", "lalpha") - 6495.2) < $epsilon, "Lalpha"); +ok( abs(Xray::Absorption -> get_energy("dy", "lbeta") - 7247.7) < $epsilon, "Lbeta");
signature.asc
Description: Digital signature