Revision 7e5d3cf8

View differences:

src/template/test/SConstruct
64 64
    "-Wall"
65 65
])
66 66

  
67
# libxml2
68
main_env.ParseConfig('xml2-config --libs --cflags')
69

  
67 70
# MYSQL
68 71
main_env.Append(LIBPATH=["/usr/lib/mysql"])
69 72
main_env.Append(CPPPATH=["/usr/include/mysql"])
src/template/test/template.cc
311 311
        CPPUNIT_ASSERT( n == 2 );
312 312
    }
313 313

  
314
    /* --------------------------------------------------------------------- */
315

  
316
    void test_from_xml()
317
    {
318
        string      str1;
319
        string      str2;
320
        Template    t_xml;
321
        int         rc;
322

  
323
        // Generate a xml from a Template generated from a text template
324
        t1->to_xml(str1);
325
        CPPUNIT_ASSERT(test_ok_xml == str1);
326

  
327
        // Parse the xml in a new Template object
328
        rc = t_xml.from_xml(str1);
329
        CPPUNIT_ASSERT(rc == 0);
330

  
331
        // Check correct output of this xml-generated Template object
332
        t_xml.to_xml(str2);
333
        CPPUNIT_ASSERT(str1 == str2);
334

  
335
        str1 = "";
336
        str2 = "";
337

  
338
        t1->to_str(str1);
339
        t_xml.to_str(str2);
340

  
341
        CPPUNIT_ASSERT(str1 == str2);
342
    }
314 343

  
315 344
    /* ********************************************************************* */
316 345
    /* ********************************************************************* */
......
351 380
                    "erase() Test",
352 381
                    &TemplateTest::test_erase));
353 382

  
383
        ts->addTest(new CppUnit::TestCaller<TemplateTest>(
384
                    "from_xml() Test",
385
                    &TemplateTest::test_from_xml));
386

  
354 387
        return ts;
355 388
    }
356 389
};

Also available in: Unified diff