summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-05-04 17:38:53 -0400
committerPaul Smith <psmith@gnu.org>2013-05-04 17:38:53 -0400
commit3484c9675a8a09904e08e00bf6842d834cd0201d (patch)
treeac9c0c1179e567213ed25f3161b64fc0254e24c7 /tests
parenta0c5d0c63f6801ca16865d04faa223cea440d2c0 (diff)
downloadgunmake-3484c9675a8a09904e08e00bf6842d834cd0201d.tar.gz
Add memory allocation cleanup to loadable objects.
Add gmk_alloc() and gmk_free() functions so loadable objects can access our memory model. Also provide a more extensive example in the manual.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog2
-rw-r--r--tests/scripts/features/loadapi6
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 991e96f..ade64f0 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,7 @@
2013-05-04 Paul Smith <psmith@gnu.org>
+ * scripts/features/loadapi: Use the new alloc functions.
+
* scripts/features/output-sync (output_sync_set): New test for
ordered recursive output for -Ojob / -Otarget.
diff --git a/tests/scripts/features/loadapi b/tests/scripts/features/loadapi
index cecb114..94a48a7 100644
--- a/tests/scripts/features/loadapi
+++ b/tests/scripts/features/loadapi
@@ -36,13 +36,17 @@ test_expand (const char *val)
static char *
func_test (const char *funcname, int argc, char **argv)
{
+ char *mem;
+
if (strcmp (funcname, "test-expand") == 0)
return test_expand (argv[0]);
if (strcmp (funcname, "test-eval") == 0)
return test_eval (argv[0]);
- return strdup ("unknown");
+ mem = gmk_alloc (strlen ("unknown") + 1);
+ strcpy (mem, "unknown");
+ return mem;
}
int