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:
parent
0ed0532457
commit
8f4e16f014
1 changed files with 5 additions and 0 deletions
|
@ -49,6 +49,11 @@ protected:
|
||||||
return TestFail;
|
return TestFail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (File::exists("/dev")) {
|
||||||
|
cerr << "Directories should not be treated as files" << endl;
|
||||||
|
return TestFail;
|
||||||
|
}
|
||||||
|
|
||||||
/* Test unnamed file. */
|
/* Test unnamed file. */
|
||||||
File file;
|
File file;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue