add Test_Realpath()
This commit is contained in:
		
							parent
							
								
									11459d3e3d
								
							
						
					
					
						commit
						1b28ed0909
					
				@ -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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user