Audio-Radio-Sirius

 view release on metacpan or  search on metacpan

t/checksum.t  view on Meta::CPAN

use Test::More tests => 4;

# test some normal short/long checksums, and check boundary conditions (00, ff)

BEGIN {
	my %CHECKSUMS = (
		'a40300df000680010901e000'
			=> '09',
		'a40300d98000'
			=> '00',
		'a40300ee002d80014204010e4a656e6e69666572204b6e617070020b4c617920497420446f776e8605244f3634458803317578'
			=> 'ff',
		'a40300a9005680019e0301244f726c616e646f20547261666669632f54616d706120696e20756e6465722034206d696e02244f726c616e646f20547261666669632f54616d706120696e20756e6465722034206d696e86042a4f524c'
			=> 'd2',
	);

	require Audio::Radio::Sirius;

	my $tuner = new Audio::Radio::Sirius;

	foreach $sum (keys %CHECKSUMS) {
		my $rawsum = pack ('H*', $sum);
		my $rawcalc = $tuner->_checksum($rawsum);

t/song_updates.t  view on Meta::CPAN

#!perl -T

use Test::More tests => 9;

# Here we're testing 80 01 updates which send song info.  these also need to call a function (the event system).  Updates on ch# 22.
our $called = 0;


BEGIN {
	my %UPDATES = (
		'16050110506574657220496c796963682054636802104672616e63657363612064612052696d06094f72636865737472618605244f3336318803386671'
# Item type: 1 Info: Peter Ilyich Tch
# Item type: 2 Info: Francesca da Rim
# Item type: 6 Info: Orchestra
# Item type: 134 Info: $O361
			=> {
		'artist' => 'Peter Ilyich Tch',
		'title' => 'Francesca da Rim',
		'composer' => 'Orchestra',
		'pid' => '$O361'
		},
		'16040104494e5853020c446f6e2774204368616e67658605244f4a495588023673'
# Item type: 1 Info: INXS
# Item type: 2 Info: Don't Change
# Item type: 134 Info: $OJIU
			=> {
		'artist' => 'INXS',
		'title' => "Don't Change",
		'composer' => undef,
		'pid' => '$OJIU'
		}
	);



( run in 0.308 second using v1.01-cache-2.11-cpan-7add2cbd662 )