1 | BEGIN { $| = 1; print "1..463\n"; } |
1 | BEGIN { $| = 1; print "1..459\n"; } |
2 | |
2 | |
3 | use common::sense; |
3 | use common::sense; |
4 | use Convert::BER::XS ':all'; |
4 | use Convert::BER::XS ':all'; |
5 | |
5 | |
6 | our $test; |
6 | our $test; |
… | |
… | |
152 | 0, -0.1, -1.00001, |
152 | 0, -0.1, -1.00001, |
153 | 123456789, -123456789, |
153 | 123456789, -123456789, |
154 | 1.234, -1.234, |
154 | 1.234, -1.234, |
155 | 0.123, -0.123, |
155 | 0.123, -0.123, |
156 | 1/256, -1/256, |
156 | 1/256, -1/256, |
157 | 1e30, 1e-30, -1e30, -1e-30, |
157 | 1e30, -1e30, |
158 | 8e30, -8e30, 5e-30, -5e-30, |
158 | 8e30, -8e30, |
159 | 1.2e20, -1.2e20, |
159 | 1.2e20, -1.2e20, |
160 | ) { |
160 | ) { |
161 | my $ber = ber_encode [ASN_UNIVERSAL, ASN_REAL, 0, $_]; |
161 | my $ber = ber_encode [ASN_UNIVERSAL, ASN_REAL, 0, $_]; |
162 | my $dec = ber_decode $ber; |
162 | my $dec = ber_decode $ber; |
163 | ok ($_ == $dec->[BER_DATA], "real $_ == $dec->[BER_DATA]"); |
163 | ok ($_ == $dec->[BER_DATA], "real $_ == $dec->[BER_DATA]"); |