Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .CI/Test/FileSystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,23 @@
#include <assert.h>
#include <string.h>

typedef enum {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it have made more sense to move the other ModelicaFileType declaration from ModelicaInternal.c to ModelicaInternal.h and re-use that?

Basically, I don't like such code duplication.

FileType_NoFile = 1,
FileType_Directory = 3
} ModelicaFileType;

int main(int argc, char **argv) {
ModelicaInternal_mkdir("abc");
ModelicaInternal_rmdir("abc");
const char* dirName = "abc";
const char* newName = "xyz";
ModelicaFileType fileType = FileType_NoFile;
ModelicaInternal_mkdir(dirName);
fileType = ModelicaInternal_stat(dirName);
assert(FileType_Directory == fileType);
ModelicaInternal_rename(dirName, newName);
fileType = ModelicaInternal_stat(dirName);
assert(FileType_NoFile == fileType);
fileType = ModelicaInternal_stat(newName);
assert(FileType_Directory == fileType);
ModelicaInternal_rmdir(newName);
return 0;
}
Loading