Browse Source

Tests: Framework - Add funcs logH1 / logH2

LIB-12
heck 1 year ago
parent
commit
d79fb50070
2 changed files with 26 additions and 1 deletions
  1. +22
    -1
      test/framework/utils.cc
  2. +4
    -0
      test/framework/utils.hh

+ 22
- 1
test/framework/utils.cc View File

@ -3,6 +3,8 @@
#include "utils.hh"
#include <iostream>
#include <pEp/identity_list.h>
#include "../../src/Adapter.hh"
@ -13,6 +15,25 @@ using namespace pEp;
namespace pEp {
namespace Test {
namespace Log {
void logH1(string msg)
{
char decoration{ '=' };
cout << endl
<< endl
<< std::string(30, decoration) << ' ' << msg << ' '
<< std::string(30, decoration) << endl;
}
void logH2(string msg)
{
char decoration{ '-' };
cout << endl
<< std::string(10, decoration) << ' ' << msg << ' '
<< std::string(10, decoration) << endl;
}
} // namespace Log
namespace Utils {
string identity_to_string(::pEp_identity* ident, bool full, int indent)
{
@ -65,7 +86,7 @@ namespace pEp {
builder << endl;
builder << std::string(indent, '\t') << "[" << endl;
indent++;
for (::identity_list * curr = idl; curr != nullptr; curr = curr->next) {
for (::identity_list* curr = idl; curr != nullptr; curr = curr->next) {
builder << identity_to_string(curr->ident, full, indent) << endl;
}
indent--;


+ 4
- 0
test/framework/utils.hh View File

@ -11,6 +11,10 @@
namespace pEp {
namespace Test {
namespace Log {
void logH1(std::string msg);
void logH2(std::string msg);
}
namespace Utils {
std::string identity_to_string(::pEp_identity* ident, bool full = true, int indent = 0);
std::string identitylist_to_string(::identity_list * idl, bool full = true, int indent = 0);


Loading…
Cancel
Save