diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-01 05:24:54 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-01 05:24:54 +0000 |
commit | 9f187b46ae761e8275362d6c1533e9fe79028c7b (patch) | |
tree | e2625f63e0c84f172c877e1fe2cbe75adf678208 /cpp/sca/modules/eval/eval-test.cpp | |
parent | 24021bd09a0d5c9664565a244c24e0bdef0908b8 (diff) |
Improved memory management using APR memory pools, changed frame allocation in eval library to support forward references and fixed memory leak in XML parsing code. Also simplified a bit the printing of lists to make them easier to read.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@831639 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/sca/modules/eval/eval-test.cpp')
-rw-r--r-- | cpp/sca/modules/eval/eval-test.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cpp/sca/modules/eval/eval-test.cpp b/cpp/sca/modules/eval/eval-test.cpp index 95a286ade0..584c8470b1 100644 --- a/cpp/sca/modules/eval/eval-test.cpp +++ b/cpp/sca/modules/eval/eval-test.cpp @@ -33,11 +33,13 @@ namespace tuscany { namespace eval { bool testEnv() { + gc_pool pool; Env globalEnv = list<value>(); - Env env = extendEnvironment(mklist<value>("a"), mklist<value>(1), globalEnv); + Env env = extendEnvironment(mklist<value>("a"), mklist<value>(1), globalEnv, pool); defineVariable("x", env, env); - //assert(lookupVariableValue(value("x"), env) == env); + assert(lookupVariableValue(value("x"), env) == env); assert(lookupVariableValue("a", env) == value(1)); + cleanupEnvironment(env); return true; } @@ -135,14 +137,15 @@ bool testEval() { assert(contains(evalOutput(testSchemeBegin), "testBegin1 ok")); assert(contains(evalOutput(testSchemeBegin), "testBegin2 ok")); assert(contains(evalOutput(testSchemeLambda), "testLambda ok")); - //assert(contains(evalOutput(testSchemeForward), "testForward ok")); + assert(contains(evalOutput(testSchemeForward), "testForward ok")); return true; } bool testEvalExpr() { + gc_pool pool; const value exp = mklist<value>("+", 2, 3); - Env env = setupEnvironment(); - const value r = evalApply(exp, env); + Env env = setupEnvironment(pool); + const value r = evalExpr(exp, env, pool); assert(r == value(5)); return true; } |