Skip to content

Commit

Permalink
simplification, we don't care about the prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Rousse authored and Guillaume Rousse committed Feb 26, 2012
1 parent 95420b5 commit 7d9eedd
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions t/inventory/windows/printers.t
Expand Up @@ -15,23 +15,23 @@ use FusionInventory::Agent::Task::Inventory::Input::Win32::Printers;

my %tests = (
xppro1 => {
USB001 => [ '6&397bdcac&0', '49R8Ka' ],
USB002 => [ '6&2ad9257f&0', undef ],
USB003 => [ '6&1605722f&0', undef ],
USB001 => '49R8Ka',
USB002 => undef,
USB003 => undef
},
xppro2 => {
USB001 => [ '6&1086615&0', 'J5J126789' ],
USB003 => [ '6&159b6df2&0', 'JV40VNJ' ],
USB004 => [ '7&20bd29b5&0', undef ],
USB001 => 'J5J126789',
USB003 => 'JV40VNJ',
USB004 => undef,
},
7 => {
USB001 => [ '7&17e8a3c3&0', 'MY26K1K34C2L' ],
USB001 => 'MY26K1K34C2L'
}
);

my $plan = 0;
foreach my $test (keys %tests) {
$plan += 2 * scalar (keys %{$tests{$test}});
$plan += scalar (keys %{$tests{$test}});
}
plan tests => $plan;

Expand All @@ -42,8 +42,7 @@ foreach my $test (keys %tests) {
my $prefix = FusionInventory::Agent::Task::Inventory::Input::Win32::Printers::_getUSBPrefix($printKey, $port);
my $serial = FusionInventory::Agent::Task::Inventory::Input::Win32::Printers::_getUSBSerial($usbKey, $prefix);

is($prefix, $tests{$test}->{$port}->[0], "prefix for printer $port");
is($serial, $tests{$test}->{$port}->[1], "serial for printer $port");
is($serial, $tests{$test}->{$port}, "serial for printer $port");
}
}

Expand Down

0 comments on commit 7d9eedd

Please sign in to comment.