test_properties.cxx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. {"MockLayout", _value("")}
  27. })}
  28. })},
  29. {"loggers", _property({
  30. {"root", _property({
  31. {"appenders", _property({
  32. {"ref", _value("Mock")}
  33. })}
  34. })}
  35. })}
  36. })}
  37. })};
  38. properties const MULTIPLEX_PROPERTY_SCHEMA{_property({
  39. {"configuration", _property({
  40. {"appenders", _property({
  41. {"Mock", _property({
  42. {"MockLayout", _value("")}
  43. })}
  44. })},
  45. {"loggers", _property({
  46. {"root", _property({
  47. {"appenders", _list({
  48. _property({{"ref", _value("Mock")}}),
  49. _property({{"ref", _value("Mock")}})
  50. })}
  51. })}
  52. })}
  53. })}
  54. })};