add Test_Realpath()

This commit is contained in:
Thomas Bernard 2020-02-15 11:05:08 +01:00
parent 11459d3e3d
commit 1b28ed0909
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
2 changed files with 18 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include "tests.h"
#include "../struct.h"
#include "../io.h"
#include "../realpath.h"
#include "../gfx2mem.h"
#include "../gfx2log.h"
@ -154,6 +155,7 @@ int Test_Read_Write_dword(void)
Remove_path(path);
return 1;
}
int Test_Read_Write_bytes(void)
{
char path[256];
@ -221,3 +223,18 @@ int Test_Read_Write_bytes(void)
Remove_path(path);
return 1;
}
int Test_Realpath(void)
{
char * path;
path = Realpath(tmpdir, NULL);
if (path == NULL)
{
GFX2_Log(GFX2_ERROR, "Realpath(\"%s\") returned NULL\n", tmpdir);
return 0;
}
GFX2_Log(GFX2_DEBUG, "Realpath(\"%s\") returned \"%s\"\n", tmpdir, path);
free(path);
return 1;
}

View File

@ -5,6 +5,7 @@ TEST(Read_Write_byte)
TEST(Read_Write_word)
TEST(Read_Write_dword)
TEST(Read_Write_bytes)
TEST(Realpath)
TEST(MOTO_MAP_pack)
TEST(CPC_compare_colors)