16 LOGGER( slog,
"test_yaml" );
18 int main(
int argc,
char** argv )
22 LERROR( slog,
"Please provide the test YAML file to be read: test_yaml.yaml" );
29 if( ! t_param_location )
31 LERROR( slog,
"File did not read!" );
35 LINFO( slog,
"File read and parsed: \n" << *t_param_location );
37 LINFO( slog,
"Checking types" );
38 if( ! t_param_location->is_node() )
40 LERROR( slog,
"Top level is not a node" );
45 if( ! t_top[
"array"].is_array() )
47 LERROR( slog,
"\"array\" is not an array" );
49 if( ! t_top[
"node"].is_node() )
51 LERROR( slog,
"\"node\" is not a node" );
53 if( ! t_top[
"value-bool"].is_value() )
55 LERROR( slog,
"\"value-bool\" is not a value" );
59 if( ! t_top[
"value-bool"]().is_bool() )
61 LERROR( slog,
"\"value-bool\" is not bool" );
64 if( ! t_top[
"value-float"].is_value() )
66 LERROR( slog,
"\"value-float\" is not a value" );
70 if( ! t_top[
"value-float"]().is_double() )
72 LERROR( slog,
"\"value-float\" is not float" );
75 if( ! t_top[
"value-int"].is_value() )
77 LERROR( slog,
"\"value-int\" is not a value" );
81 if( ! t_top[
"value-int"]().is_int() )
83 LERROR( slog,
"\"value-int\" is not int" );
86 if( ! t_top[
"value-string"].is_value() )
88 LERROR( slog,
"\"value-string\" is not a value" );
92 if( ! t_top[
"value-string"]().is_string() )
94 LERROR( slog,
"\"value-string\" is not string" );
97 if( ! t_top[
"value-unsigned"].is_value() )
99 LERROR( slog,
"\"value-unsigned\" is not a value" );
103 if( ! t_top[
"value-unsigned"]().is_uint() )
105 LERROR( slog,
"\"value-unsigned\" is not unsigned" );
108 LINFO( slog,
"If there were no errors, then the type tests passed" );
114 bool t_did_write_file = t_output.
write_file( *t_param_location,
"test_output.yaml" );
116 if( ! t_did_write_file )
118 LERROR( slog,
"File did not write!" );
122 LINFO( slog,
"File written successfully (test_output.yaml)" );
LOGGER(mtlog, "authentication")
virtual bool write_file(const param &a_to_write, const std::string &a_filename, const param_node &a_options=param_node())
Contains the logger class and macros, based on Kasper's KLogger class.
std::unique_ptr< param > param_ptr_t
int main(int argc, char **argv)