#7130 closed defect (fixed)

FileSystem.Read() error is not handled

Reported by: asmirnov Assignee:
Priority: P2 Milestone:
Module: Libadblockplus Keywords:
Cc: sergz Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):




libadblockplus has FileSystem abstraction.
Read() call can result in error callback called:

There is a test for this (read with error):

However it does not check if error is equal to undefined, but just checks if it's not equal to empty string.
The affected revision of libadblockplus is f2df538b1d66b982fba18a0bc36cf27c1b3bc716 and the most recent most likely.

How to reproduce

  1. Modify the test as follows:
    $git diff
    diff --git a/test/FileSystemJsObject.cpp b/test/FileSystemJsObject.cpp
    index 051febd..c2ca271 100644
    --- a/test/FileSystemJsObject.cpp
    +++ b/test/FileSystemJsObject.cpp
    @@ -158,6 +158,7 @@ TEST_F(FileSystemJsObjectTest, ReadError)
       std::string error;
       ReadFile(GetJsEngine(), content, error);
       ASSERT_NE("", error);
    +  ASSERT_NE("undefined", error);
       ASSERT_EQ("undefined", content);
  2. Run the test with make test FILTER=FileSystemJsObject*
  3. Make sure the test fails

Observed behaviour

The test fails: error is equal to undefined.

Expected behaviour

The test does not fail and error is not equal to undefined.

Change History (2)

comment:1 Changed 16 months ago by sergz

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 16 months ago by sergz

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.