Browse Source

Tests: Framework - add identitylist_to_string()

LIB-12
heck 1 year ago
parent
commit
1de257538d
2 changed files with 21 additions and 1 deletions
  1. +19
    -1
      test/framework/utils.cc
  2. +2
    -0
      test/framework/utils.hh

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

@ -3,7 +3,7 @@
#include "utils.hh"
#include <pEp/keymanagement.h>
#include <pEp/identity_list.h>
#include "../../src/Adapter.hh"
#include "../../src/adapter_group.h"
@ -58,6 +58,24 @@ namespace pEp {
return builder.str();
}
std::string identitylist_to_string(::identity_list* idl, bool full, int indent)
{
stringstream builder;
if (idl != nullptr) {
builder << endl;
builder << std::string(indent, '\t') << "[" << endl;
indent++;
for (::identity_list * curr = idl; curr != nullptr; curr = curr->next) {
builder << identity_to_string(curr->ident, full, indent) << endl;
}
indent--;
builder << std::string(indent, '\t') << "]";
} else {
builder << "NULL";
}
return builder.str();
}
string member_to_string(::pEp_member* member, bool full, int indent)
{


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

@ -6,12 +6,14 @@
#include <string>
#include <pEp/message.h>
#include <pEp/identity_list.h>
#include <pEp/group.h>
namespace pEp {
namespace Test {
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);
std::string member_to_string(::pEp_member* member, bool full = true, int indent = 0);
std::string memberlist_to_string(::member_list* mbl, bool full = true, int indent = 0);
std::string group_to_string(::pEp_group* group, bool full = true, int indent = 0);


Loading…
Cancel
Save