Skip to content

Commit

Permalink
Merge pull request #930 from jphickey/fix-929-objid-check
Browse files Browse the repository at this point in the history
Fix #929, use test function for osal_id_t
  • Loading branch information
astrogeco authored Mar 31, 2021
2 parents 3d3fe01 + bb0d8bd commit 6dbb0c7
Showing 1 changed file with 2 additions and 4 deletions.
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(%lu) not defined", OS_ObjectIdToInteger(fd));

/* 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(%lu) not defined", OS_ObjectIdToInteger(fd));

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

0 comments on commit 6dbb0c7

Please sign in to comment.