diff tests/plrtest.c @ 777:ed60a7ee3ebb

Change JSSMOD loader to use DMResources.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 24 May 2013 01:19:11 +0300
parents 3d813c81f33c
children 21ad08cdf408
line wrap: on
line diff
--- a/tests/plrtest.c	Thu May 23 23:48:24 2013 +0300
+++ b/tests/plrtest.c	Fri May 24 01:19:11 2013 +0300
@@ -146,18 +146,9 @@
 #ifdef JSS_SUP_JSSMOD
     if (result != 0)
     {
-        size_t bufgot, bufsize = dmfsize(file);
-        Uint8 *buf = dmMalloc(bufsize);
         dmfseek(file, 0L, SEEK_SET);
-        fprintf(stderr, "* Trying JSSMOD (%d bytes, %p)...\n", bufsize, buf);
-        if ((bufgot = dmfread(buf, 1, bufsize, file)) != bufsize)
-        {
-            fprintf(stderr, "Error reading file (not enough data %d), #%d: %s\n",
-                bufgot, dmferror(file), dmErrorStr(dmferror(file)));
-            return 2;
-        }
-        result = jssLoadJSSMOD(buf, bufsize, &mod);
-        dmFree(buf);
+        dmMsg(1, "* Trying JSSMOD ...\n");
+        result = jssLoadJSSMOD(file, &mod);
     }
 #endif
     dmf_close(file);