2007-12-07 16:29:27 +00:00
|
|
|
/*
|
|
|
|
* Mocked objects to simulate an input filesystem.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MOCKED_FSRC_H_
|
|
|
|
#define MOCKED_FSRC_H_
|
|
|
|
|
2008-01-08 20:23:24 +00:00
|
|
|
struct mock_file {
|
|
|
|
IsoFilesystem *fs;
|
|
|
|
struct mock_file *parent;
|
|
|
|
struct stat atts;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
/* for links, link dest. For dirs, children */
|
|
|
|
void *content;
|
|
|
|
};
|
|
|
|
|
2007-12-07 16:29:27 +00:00
|
|
|
/**
|
2008-01-08 20:23:24 +00:00
|
|
|
* A mocked fs.
|
2007-12-07 16:29:27 +00:00
|
|
|
*/
|
|
|
|
int test_mocked_filesystem_new(IsoFilesystem **fs);
|
|
|
|
|
2008-01-08 20:23:24 +00:00
|
|
|
struct mock_file *test_mocked_fs_get_root(IsoFilesystem *fs);
|
2007-12-07 16:29:27 +00:00
|
|
|
|
2008-01-08 20:23:24 +00:00
|
|
|
int test_mocked_fs_add_dir(const char *name, struct mock_file *parent,
|
|
|
|
struct stat atts, struct mock_file **dir);
|
2007-12-07 16:29:27 +00:00
|
|
|
|
2008-01-08 20:23:24 +00:00
|
|
|
int test_mocked_fs_add_symlink(const char *name, struct mock_file *p,
|
|
|
|
struct stat atts, const char *dest, struct mock_file **node);
|
2007-12-07 16:29:27 +00:00
|
|
|
|
|
|
|
#endif /*MOCKED_FSRC_H_*/
|