Unit test should not pass with bad key
Unit test needed to capture a bad key scenario, which did not get returned false. However, bad keys are now CRC checked and so willalways return false - and so the case clause for bad key can be dropped.
This commit is contained in:
parent
5e95e6a6b3
commit
8011a9cde1
1 changed files with 2 additions and 9 deletions
|
@ -2410,17 +2410,10 @@ safe_read_test() ->
|
|||
% Sometimes corruption may yield a correct answer
|
||||
% for example if Value Length is too big
|
||||
%
|
||||
% This cna only happen with a corrupted value length at
|
||||
% This can only happen with a corrupted value length at
|
||||
% the end of the file - which is just a peculiarity of
|
||||
% the test
|
||||
?assertMatch(true, BadValueL > ValueL);
|
||||
{_BadKey, Value, KeyL, ValueL} ->
|
||||
% Key is not CRC checked - so may be bit flipped to
|
||||
% something which is still passes through binary_to_term
|
||||
% Assumption is that the application should always
|
||||
% ultimately know the key - and so will be able to check
|
||||
% against the Key it is trying for.
|
||||
ok
|
||||
?assertMatch(true, BadValueL > ValueL)
|
||||
end,
|
||||
ok = file:close(Handle)
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue