test: file: Check that directories are not treated as files

Directories can not be opened as a file, so the exists() check should
not return true for a path which points to a directory.

Directories are not handled by the File class.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2020-12-22 13:50:20 +00:00
parent 0ed0532457
commit 8f4e16f014

View file

@ -49,6 +49,11 @@ protected:
return TestFail;
}
if (File::exists("/dev")) {
cerr << "Directories should not be treated as files" << endl;
return TestFail;
}
/* Test unnamed file. */
File file;