1 #define BOOST_TEST_MODULE config 
    2 #define BOOST_TEST_DYN_LINK 
    3 #include <boost/test/unit_test.hpp> 
    7 #include "flame/config.h" 
    9 BOOST_AUTO_TEST_CASE(config_getset)
 
   13     C.
set<
double>(
"hello", 4.2);
 
   15     BOOST_CHECK_CLOSE(C.get<
double>(
"hello"), 4.2, 0.1);
 
   17     BOOST_CHECK_THROW(C.get<
double>(
"world"), key_error);
 
   19     BOOST_CHECK_CLOSE(C.get<
double>(
"world", 5.2), 5.2, 0.1);
 
   22 static const char config_print_stmt_input[] =
 
   27 "foo : bar, x=\"y\";\n" 
   28 "baz : LINE = (foo);\n";
 
   30 BOOST_AUTO_TEST_CASE(config_print_stmt)
 
   32     std::ostringstream strm;
 
   36     std::auto_ptr<Config> conf(parse.
parse_byte(config_print_stmt_input, 
sizeof(config_print_stmt_input)-1));
 
   38     BOOST_CHECK_EQUAL(strm.str(), 
"On line 2 : 14\n" "On line 4 : \"test\"\n");
 
void setPrinter(std::ostream *)
Set output for lexer/parser error messages. 
 
void set(const std::string &name, typename boost::call_traits< typename detail::is_config_value< T >::type >::param_type val)
 
Interface to lattice file parser. 
 
Associative configuration container. 
 
Config * parse_byte(const char *s, size_t len, const char *path=NULL)
Parse from byte buffer.