Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #929, use test function for osal_id_t #930

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Changes from 1 commit
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
6 changes: 2 additions & 4 deletions src/tests/file-api-test/file-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ void TestCreatRemove(void)
UtAssert_True(status == OS_SUCCESS, "status after remove max name length file = %d", (int)status);

/* try creating with file name too big, should fail */
fd = ~OS_OBJECT_ID_UNDEFINED;
status = OS_OpenCreate(&fd, longfilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_READ_WRITE);
UtAssert_True(status < OS_SUCCESS, "status after create file name too long = %d", (int)status);
UtAssert_UINT32_EQ(fd, OS_OBJECT_ID_UNDEFINED);
UtAssert_True(!OS_ObjectIdDefined(fd), "fd == OS_OBJECT_ID_UNDEFINED");
jphickey marked this conversation as resolved.
Show resolved Hide resolved

/* try removing with file name too big. Should Fail */
status = OS_remove(longfilename);
Expand Down Expand Up @@ -235,10 +234,9 @@ void TestOpenClose(void)
UtAssert_True(status != OS_SUCCESS, "status after close = %d", (int)status);

/* open a file that was never in the system */
fd = ~OS_OBJECT_ID_UNDEFINED;
status = OS_OpenCreate(&fd, "/drive0/FileNotHere", OS_FILE_FLAG_NONE, OS_READ_ONLY);
UtAssert_True(status < OS_SUCCESS, "status after open = %d", (int)status);
UtAssert_UINT32_EQ(fd, OS_OBJECT_ID_UNDEFINED);
UtAssert_True(!OS_ObjectIdDefined(fd), "fd == OS_OBJECT_ID_UNDEFINED");

/* try removing the file from the drive to end the function */
status = OS_remove(filename);
Expand Down