From 17a7b5714a26d137579c78699aa112431f3a31d2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 6 Mar 2012 22:04:28 +0000 Subject: Fix test for file state saving by comparing contents, not path. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4026 a436a847-0d15-0410-975c-d299462d15a1 --- test/test_plugin.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test/test_plugin.c') diff --git a/test/test_plugin.c b/test/test_plugin.c index 0a66852..b0691ed 100644 --- a/test/test_plugin.c +++ b/test/test_plugin.c @@ -15,8 +15,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _BSD_SOURCE /* for realpath */ - #include #include #include @@ -319,9 +317,13 @@ restore(LV2_Handle instance, if (apath) { char* path = map_path->absolute_path(map_path->handle, apath); - if (strcmp(path, plugin->tmp_file_path)) { - fprintf(stderr, "ERROR: Restored bad path `%s' != `%s'\n", - path, plugin->tmp_file_path); + FILE* f = fopen(path, "r"); + char str[8]; + fread(str, 1, sizeof(str), f); + fclose(f); + if (strcmp(str, "Hello\n")) { + fprintf(stderr, "error: Restored bad file contents `%s' != `Hello'\n", + str); } free(path); } -- cgit v1.2.1