Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_DeviceData_rmsg-definition.txt #677

Merged
merged 4 commits into from
Nov 11, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions UnitTest/tests/test_DeviceData_rmsg-definition.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,23 @@ defmod test_DeviceData_rmsg UnitTest dummyDuino (
$dmsg_matched=0;
$SD_Dispatch_calledCounter=0;
SIGNALduino_Parse($targetHash, $targetHash, $targetHash->{NAME}, "\002".$tData->{rmsg}."\003") if (defined($tData->{rmsg}));
if ($SD_Dispatch->called() >0 ) {
$noTestRun=0;
my $expected_repeat=min(4,$tData->{repeat}+1);

TODO: {
local $TODO = "Checking for repeats is not finishes, because number of repeats is not always number of dispatches";
is($SD_Dispatch_calledCounter, $expected_repeat, "check number of dispatch attempts") if (defined($tData->{repeat}));
};

ok($id_matched,"SIGNALduno_Dispatch check id ") || note explain (($SD_Dispatch->called_with())[4] , " vs ", $testSet->{id});
ok($dmsg_matched,"SIGNALduno_Dispatch check dmsg ") || note explain (($SD_Dispatch->called_with())[2] , " vs ", $testSet->{dmsg});

if ($SD_Dispatch->called() >0 ) {
$noTestRun=0;

ok($id_matched,"SIGNALduno_Dispatch check id ") || note explain (($SD_Dispatch->called_with())[4] , " vs ", $testSet->{id});
ok($dmsg_matched,"SIGNALduno_Dispatch check dmsg ") || note explain (($SD_Dispatch->called_with())[2] , " vs ", $testSet->{dmsg});

if (defined($tData->{dispatch_repeats})) {
ok( $tData->{dispatch_repeats} , "JSON dispatch_repeats entry available");
sidey79 marked this conversation as resolved.
Show resolved Hide resolved
## some tests please added in separate Travistest on SIGNALduino_TOOL ##
sidey79 marked this conversation as resolved.
Show resolved Hide resolved
ok( $tData->{dispatch_repeats} =~ /\d+/ , "JSON dispatch_repeats entry check numeric");
}

my $expected_repeat=min(1,$tData->{dispatch_repeats});
sidey79 marked this conversation as resolved.
Show resolved Hide resolved
TODO: {
local $TODO = "Checking dispatches (all dispatches are counted across all modules)";
is($tData->{dispatch_repeats}, $SD_Dispatch_calledCounter-1, "JSON dispatch_repeats accuracy") if (defined($tData->{dispatch_repeats}));
};
} else { diag "SIGNALduno_Dispatch was not called, this must be an error"; }
};

Expand Down