summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-06 22:04:28 +0000
committerDavid Robillard <d@drobilla.net>2012-03-06 22:04:28 +0000
commit17a7b5714a26d137579c78699aa112431f3a31d2 (patch)
treeb18b9da49a327f1d9fad5ba61c28bc7e54795315 /test
parent01c0927ce05494fccc7077022d7e40938ff6ca43 (diff)
downloadlilv-17a7b5714a26d137579c78699aa112431f3a31d2.tar.gz
lilv-17a7b5714a26d137579c78699aa112431f3a31d2.tar.bz2
lilv-17a7b5714a26d137579c78699aa112431f3a31d2.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/test_plugin.c12
1 files changed, 7 insertions, 5 deletions
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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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);
}