fileid: rename os_file_id_equal_file_info

This commit is contained in:
Stefan Hoffmann
2014-08-27 20:14:39 +02:00
parent 3cf7a17a44
commit 10813ce38c
3 changed files with 5 additions and 5 deletions

View File

@@ -1181,7 +1181,7 @@ static int cs_insert_filelist(char *fname, char *ppath, char *flags,
i = -1; /* can be set to the index of an empty item in csinfo */ i = -1; /* can be set to the index of an empty item in csinfo */
for (j = 0; j < csinfo_size; j++) { for (j = 0; j < csinfo_size; j++) {
if (csinfo[j].fname != NULL if (csinfo[j].fname != NULL
&& os_fileid_equal_file_info(&(csinfo[j].file_id), file_info)) { && os_fileid_equal_fileinfo(&(csinfo[j].file_id), file_info)) {
if (p_csverbose) if (p_csverbose)
(void)EMSG(_("E568: duplicate cscope database not added")); (void)EMSG(_("E568: duplicate cscope database not added"));
return -1; return -1;

View File

@@ -453,7 +453,7 @@ bool os_fileid_equal(const FileID *file_id_1, const FileID *file_id_2)
/// @param file_id Pointer to a `FileID` /// @param file_id Pointer to a `FileID`
/// @param file_info Pointer to a `FileInfo` /// @param file_info Pointer to a `FileInfo`
/// @return `true` if the `FileID` and the `FileInfo` represent te same file. /// @return `true` if the `FileID` and the `FileInfo` represent te same file.
bool os_fileid_equal_file_info(const FileID *file_id, bool os_fileid_equal_fileinfo(const FileID *file_id,
const FileInfo *file_info) const FileInfo *file_info)
{ {
return file_id->inode == file_info->stat.st_ino return file_id->inode == file_info->stat.st_ino

View File

@@ -680,14 +680,14 @@ describe('fs function', function()
end) end)
end) end)
describe('os_fileid_equal_file_info', function() describe('os_fileid_equal_fileinfo', function()
it('returns true if file_id and file_info represent the same file', function() it('returns true if file_id and file_info represent the same file', function()
local file_id = file_id_new() local file_id = file_id_new()
local file_info = file_info_new() local file_info = file_info_new()
local path = 'unit-test-directory/test.file' local path = 'unit-test-directory/test.file'
assert.is_true((fs.os_fileid(path, file_id))) assert.is_true((fs.os_fileid(path, file_id)))
assert.is_true((fs.os_fileinfo(path, file_info))) assert.is_true((fs.os_fileinfo(path, file_info)))
assert.is_true((fs.os_fileid_equal_file_info(file_id, file_info))) assert.is_true((fs.os_fileid_equal_fileinfo(file_id, file_info)))
end) end)
it('returns false if file_id and file_info represent different files', function() it('returns false if file_id and file_info represent different files', function()
@@ -697,7 +697,7 @@ describe('fs function', function()
local path_2 = 'unit-test-directory/test_2.file' local path_2 = 'unit-test-directory/test_2.file'
assert.is_true((fs.os_fileid(path_1, file_id))) assert.is_true((fs.os_fileid(path_1, file_id)))
assert.is_true((fs.os_fileinfo(path_2, file_info))) assert.is_true((fs.os_fileinfo(path_2, file_info)))
assert.is_false((fs.os_fileid_equal_file_info(file_id, file_info))) assert.is_false((fs.os_fileid_equal_fileinfo(file_id, file_info)))
end) end)
end) end)
end) end)