10bbfda8aSnia/* 20bbfda8aSnia * Test ExpandFilePath() 30bbfda8aSnia */ 40bbfda8aSnia 50bbfda8aSnia#include "ctwm.h" 60bbfda8aSnia 70bbfda8aSnia#include <string.h> 80bbfda8aSnia#include <stdio.h> 90bbfda8aSnia#include <stdlib.h> 100bbfda8aSnia 110bbfda8aSnia#include "util.h" 120bbfda8aSnia 130bbfda8aSniaint 140bbfda8aSniamain(int argc, char *argv[]) 150bbfda8aSnia{ 160bbfda8aSnia char *in = strdup("foo:~/bar"); 170bbfda8aSnia Home = "FOO"; // Just overwrite global 180bbfda8aSnia#define EXPECT "foo:FOO/bar" 190bbfda8aSnia 200bbfda8aSnia char *ret = ExpandFilePath(in); 21b18c2d1eSnia if(strcmp(ret, EXPECT) == 0) { 220bbfda8aSnia exit(0); 23b18c2d1eSnia } 240bbfda8aSnia fprintf(stderr, "'%s' != expected '%s'\n", ret, EXPECT); 250bbfda8aSnia exit(1); 260bbfda8aSnia} 27