From 2c621eaadc2808dd87dfdb518f600eb874c6684d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 27 Jun 2011 23:26:51 -0400 Subject: [PATCH] Unit Tests - The dom.t tests were segfaulting because they used a blank Context with no arguments, and when the DOM referecne 'context.program' was queried, it failed because there was no Context::args[0]. --- test/dom.t.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/dom.t.cpp b/test/dom.t.cpp index 0183a2ca7..24f349a46 100644 --- a/test/dom.t.cpp +++ b/test/dom.t.cpp @@ -46,14 +46,16 @@ int main (int argc, char** argv) try { - DOM dom; + // Prime the pump. + context.args.capture ("task"); // TODO dom.get rc.name + DOM dom; t.is (dom.get ("system.version"), VERSION, "DOM system.version -> VERSION"); t.is (dom.get ("system.lua.version"), LUA_RELEASE, "DOM system.lua.version -> LUA_RELEASE"); t.ok (dom.get ("system.os") != "", "DOM system.os -> != Unknown"); - t.is (dom.get ("context.program"), "", "DOM context.program -> ''"); - t.is (dom.get ("context.args"), "", "DOM context.args -> ''"); + t.is (dom.get ("context.program"), "task", "DOM context.program -> 'task'"); + t.is (dom.get ("context.args"), "task", "DOM context.args -> 'task'"); t.is (dom.get ("context.width"), "0", "DOM context.width -> '0'"); t.is (dom.get ("context.height"), "0", "DOM context.height -> '0'");