test_properties.cxx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // mock_properties.cxx
  3. // logger_test
  4. //
  5. // Created by Sam Jaffe on 4/2/19.
  6. //
  7. #include "logger/properties.h"
  8. using logging::properties;
  9. namespace {
  10. properties _property(std::map<std::string, properties> const& m) {
  11. return properties{properties::OBJECT, m, {}, {}};
  12. }
  13. properties _list(std::vector<properties> const& l) {
  14. return properties{properties::ARRAY, {}, l, {}};
  15. }
  16. properties _value(std::string const& s) {
  17. return properties{properties::STRING, {}, {}, s};
  18. }
  19. }
  20. extern properties const MIN_PROPERTY_SCHEMA;
  21. extern properties const MULTIPLEX_PROPERTY_SCHEMA;
  22. properties const MIN_PROPERTY_SCHEMA{_property({
  23. {"configuration", _property({
  24. {"appenders", _property({
  25. {"Mock", _property({})}
  26. })},
  27. {"loggers", _property({
  28. {"root", _property({
  29. {"appenders", _property({
  30. {"ref", _value("Mock")}
  31. })}
  32. })}
  33. })}
  34. })}
  35. })};
  36. properties const MULTIPLEX_PROPERTY_SCHEMA{_property({
  37. {"configuration", _property({
  38. {"appenders", _property({
  39. {"Mock", _property({})}
  40. })},
  41. {"loggers", _property({
  42. {"root", _property({
  43. {"appenders", _list({
  44. _property({{"ref", _value("Mock")}}),
  45. _property({{"ref", _value("Mock")}})
  46. })}
  47. })}
  48. })}
  49. })}
  50. })};