Skip to content

Commit

Permalink
Fix #752, Utilize UTASSERT_CASETYPE_NA to report OS_ERR_NOT_IMPLEMENTED
Browse files Browse the repository at this point in the history
  • Loading branch information
zanzaben committed Feb 17, 2021
1 parent ff4f523 commit ebef88b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/tests/file-api-test/file-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void TestChmod(void)
}
else
{
UtPrintf("OS_chmod not implemented for write only\n");
UtAssert_Type(NA, false, "OS_chmod not implemented for write only");
}

/*Testing Read Only */
Expand All @@ -285,7 +285,7 @@ void TestChmod(void)
}
else
{
UtPrintf("OS_chmod not implemented for read only\n");
UtAssert_Type(NA, false, "OS_chmod not implemented for read only");
}

/*Testing Read Write */
Expand All @@ -300,7 +300,7 @@ void TestChmod(void)
}
else
{
UtPrintf("OS_chmod not implemented for read write\n");
UtAssert_Type(NA, false, "OS_chmod not implemented for read write");
}

/*Removing the file */
Expand Down
6 changes: 3 additions & 3 deletions src/tests/network-api-test/network-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void TestDatagramNetworkApi_Setup(void)
actual = OS_SocketOpen(&socket_id, OS_SocketDomain_INET6, OS_SocketType_DATAGRAM);
if (actual == OS_ERR_NOT_IMPLEMENTED)
{
UtPrintf("INET6 not supported\n");
UtAssert_Type(NA, false, "INET6 not supported");
}
else
{
Expand All @@ -135,7 +135,7 @@ void TestDatagramNetworkApi_Setup(void)
actual = OS_SocketAddrInit(&addr, OS_SocketDomain_INET6);
if (actual == OS_ERR_NOT_IMPLEMENTED)
{
UtPrintf("INET6 not supported\n");
UtAssert_Type(NA, false, "INET6 not supported");
}
else
{
Expand All @@ -145,7 +145,7 @@ void TestDatagramNetworkApi_Setup(void)
actual = OS_SocketAddrInit(NULL, OS_SocketDomain_INET6);
if (actual == OS_ERR_NOT_IMPLEMENTED)
{
UtPrintf("INET6 not supported\n");
UtAssert_Type(NA, false, "INET6 not supported");
}
else
{
Expand Down
24 changes: 18 additions & 6 deletions src/tests/symbol-api-test/symbol-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,36 @@ void TestSymbolApi(void)
*/
UtPrintf("Dumping symbol table with a limit of 32768 bytes\n");
status = OS_SymbolTableDump("/ram/SymbolTable32k.dat", 32768);
UtAssert_True(status == OS_SUCCESS || status == OS_ERR_NOT_IMPLEMENTED, "status after 32k OS_SymbolTableDump = %d",
(int)status);
if(status == OS_ERR_NOT_IMPLEMENTED){
UtAssert_Type(NA, false, "Module API not implemented");
}
else{
UtAssert_True(status == OS_SUCCESS, "status after 32k OS_SymbolTableDump = %d",(int)status);
}

/*
** dump the symbol table with a 128k byte limit
*/
UtPrintf("Dumping symbol table with a limit of 131072 bytes\n");
status = OS_SymbolTableDump("/ram/SymbolTable128k.dat", 131072);
UtAssert_True(status == OS_SUCCESS || status == OS_ERR_NOT_IMPLEMENTED, "status after 128k OS_SymbolTableDump = %d",
(int)status);
if(status == OS_ERR_NOT_IMPLEMENTED){
UtAssert_Type(NA, false, "Module API not implemented");
}
else{
UtAssert_True(status == OS_SUCCESS, "status after 128k OS_SymbolTableDump = %d",(int)status);
}

/*
** dump the symbol table with a 512k byte limit
*/
UtPrintf("Dumping symbol table with a limit of 524288 bytes\n");
status = OS_SymbolTableDump("/ram/SymbolTable512k.dat", 524288);
UtAssert_True(status == OS_SUCCESS || status == OS_ERR_NOT_IMPLEMENTED, "status after 512k OS_SymbolTableDump = %d",
(int)status);
if(status == OS_ERR_NOT_IMPLEMENTED){
UtAssert_Type(NA, false, "Module API not implemented");
}
else{
UtAssert_True(status == OS_SUCCESS, "status after 512k OS_SymbolTableDump = %d",(int)status);
}

/*
** Test the symbol lookup
Expand Down

0 comments on commit ebef88b

Please sign in to comment.