Commit 0d9c13bc authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Revert "Tests.pm: grow test pattern map to the number of specified FIUs"

Does not do what the commit message says at all.
parent 2fa3de9e
......@@ -88,7 +88,7 @@ sub new {
# create a default instance
$self->{'design'} = {};
$self->_set_defaults(TESTCONSTMAP, $self->{'design'}, $phase, $global_settings_ref);
$self->_set_defaults(TESTCONSTMAP, $self->{'design'}, $phase);
$self->{'design'}->{'NUM_TESTS'} = $num_tests;
my $tkm_ref = TESTCONSTMAP;
......@@ -268,7 +268,7 @@ sub _read_settingsfile {
$logger->error($msg);
push(@$msg_ref, $msg);
}
$self->_set_defaults(TESTCONSTMAP, $design_ref, $phase, $global_settings_ref);
$self->_set_defaults(TESTCONSTMAP, $design_ref, $phase);
$design_ref = _rename_import(TESTCONSTMAP, $design_ref);
if (!defined($design_ref)) {
......@@ -318,7 +318,7 @@ sub _read_settingsfile {
}
my $tmp_test = {};
$self->_set_defaults($self->{'TESTPATMAP'}, $tmp_test, $phase, $global_settings_ref);
$self->_set_defaults($self->{'TESTPATMAP'}, $tmp_test, $phase);
# overwrite default entries
foreach my $k (keys(%{$test_ref})) {
......@@ -352,14 +352,8 @@ sub _read_settingsfile {
$design_ref->{'NUM_TESTS'} = $test_num; # assume the best if TEST_NUM constant is not given
}
my $i = $test_num;
for (; $i < $global_settings_ref->{'design'}->{'FIU_NUM'}; $i++) {
my $tmp_test = {};
$self->_set_defaults($self->{'TESTPATMAP'}, $tmp_test, $phase, $global_settings_ref);
$self->{'tests'}->[$i] = $tmp_test;
}
splice(@{$self->{'tests'}}, $test_num);
$logger->info("Successfully read in design constants and $test_num TEST definitions from FIJI Tests file \"$fiji_ini_file\".");
splice(@{$self->{'tests'}}, $i);
return ($self, $msg_ref);
}
......@@ -410,13 +404,12 @@ sub set_test_defaults {
# @brief Set defaults according to FIJI.pm.
sub _set_defaults {
my $logger = get_logger("");
my ($self, $map_ref, $consts_ref, $phase, $global_settings_ref) = @_;
my ($self, $map_ref, $consts_ref, $phase) = @_;
foreach my $k (keys(%{$map_ref})) {
if (exists($map_ref->{$k}->{'default'})) {
# Set default only if it is not mandatory in the given phase.
# In GUI mode everything is optional... the user can modify it before starting any test.
if (defined($phase) && (scalar(grep { $_ eq $phase } @{$map_ref->{$k}->{'phases_opt'}}) == 0 && $phase ne "GUI")) {
if (defined($phase) && scalar(grep { $_ eq $phase } @{$map_ref->{$k}->{'phases_opt'}}) == 0) {
next;
}
......@@ -427,7 +420,7 @@ sub _set_defaults {
my $def;
if (ref($map_ref->{$k}->{default}) eq 'CODE') {
$def = $map_ref->{$k}->{'default'}->($global_settings_ref);
$def = $map_ref->{$k}->{'default'}->($self->{'settings'});
} else {
$def = $map_ref->{$k}->{'default'};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment