From c6dd17a1435db36eeaff24e40a7cc212ee7214a0 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 2 Aug 2013 10:27:19 +0200 Subject: Using SimpleContext in SimpleMustache's setTemplate, as it reads from a Handle using readU8. We'll switch readU8 to use a Future. --- tests/test-Http.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/test-Http.cc b/tests/test-Http.cc index cd183ce..1ea040b 100644 --- a/tests/test-Http.cc +++ b/tests/test-Http.cc @@ -25,13 +25,20 @@ const char htmlTemplateStr[] = "\n" ; -class TestHtmlTemplate : public AtStart { - public: - TestHtmlTemplate() : AtStart(10), htmlTemplate(m_template) { } - virtual void doStart() { m_template.setTemplate(htmlTemplateStr); } +class TestHtmlTemplateTask : public Task { + virtual void Do() { m_template.setTemplate(htmlTemplateStr); } + virtual const char * getName() const { return "TestHtmlTemplateTask"; } + SimpleMustache & m_template; +public: + TestHtmlTemplateTask(SimpleMustache & htmlTemplate) : m_template(htmlTemplate) { } +}; +class TestHtmlTemplate : public AtStartAsTask { + public: + TestHtmlTemplate() : AtStartAsTask(10), htmlTemplate(m_template) { } + virtual Task * createStartTask() { return new TestHtmlTemplateTask(m_template); } const SimpleMustache & htmlTemplate; - private: + public: SimpleMustache m_template; }; -- cgit v1.2.3