本文整理汇总了C++中Messenger::getSecureFromBitmunk方法的典型用法代码示例。如果您正苦于以下问题:C++ Messenger::getSecureFromBitmunk方法的具体用法?C++ Messenger::getSecureFromBitmunk怎么用?C++ Messenger::getSecureFromBitmunk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messenger
的用法示例。
在下文中一共展示了Messenger::getSecureFromBitmunk方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accountGetTest
static void accountGetTest(Node& node, TestRunner& tr)
{
tr.group("accounts");
Messenger* messenger = node.getMessenger();
tr.test("get");
{
Url url("/api/3.0/accounts/?owner=900");
// get all accounts
User user;
messenger->getSecureFromBitmunk(&url, user, node.getDefaultUserId());
printf("\nAccounts:\n");
dumpDynamicObject(user);
}
tr.passIfNoException();
tr.ungroup();
tr.group("account");
tr.test("get");
{
// create url for obtaining users
Url url("/api/3.0/accounts/9000");
// get account
Account account;
assertNoException(
messenger->getSecureFromBitmunk(
&url, account, node.getDefaultUserId()));
printf("\nAccount:\n");
dumpDynamicObject(account, false);
}
tr.passIfNoException();
tr.ungroup();
}
示例2: reviewGetTest
static void reviewGetTest(Node& node, TestRunner& tr)
{
tr.group("reviews");
Messenger* messenger = node.getMessenger();
tr.test("user get");
{
// create url for obtaining user reviews
Url url("/api/3.0/reviews/user/900");
// get account
DynamicObject reviews;
assertNoException(
messenger->getSecureFromBitmunk(
&url, reviews, node.getDefaultUserId()));
printf("\nReviews:\n");
dumpDynamicObject(reviews, false);
}
tr.passIfNoException();
tr.test("media get");
{
// create url for obtaining media reviews
Url url("/api/3.0/reviews/media/1");
// get account
DynamicObject reviews;
assertNoException(
messenger->getSecureFromBitmunk(
&url, reviews, node.getDefaultUserId()));
printf("\nReviews:\n");
dumpDynamicObject(reviews, false);
}
tr.passIfNoException();
tr.ungroup();
}
示例3: pingPerfTest
static void pingPerfTest(Node& node, TestRunner& tr)
{
tr.group("ping perf");
Messenger* messenger = node.getMessenger();
// number of loops for each test
Config cfg = tr.getApp()->getConfig();
//node.getConfigManager()->getConfig(
// tester->getApp()->getMetaConfig()["groups"]["main"]->getString());
int n = cfg->hasMember("loops") ? cfg["loops"]->getInt32() : 50;
tr.test("insecure get");
{
Url url("/api/3.0/system/test/ping");
DynamicObject dummy;
uint64_t startTime = Timer::startTiming();
for(int i = 0; i < n; ++i)
{
messenger->getFromBitmunk(&url, dummy);
}
double dt = Timer::getSeconds(startTime);
printf("t=%g ms, r=%g ms, r/s=%g", dt * 1000.0, dt/n * 1000.0, n/dt);
}
tr.passIfNoException();
tr.test("secure get");
{
Url url("/api/3.0/system/test/ping");
DynamicObject dummy;
uint64_t startTime = Timer::startTiming();
for(int i = 0; i < n; ++i)
{
messenger->getSecureFromBitmunk(&url, dummy, node.getDefaultUserId());
}
double dt = Timer::getSeconds(startTime);
printf("t=%g ms, r=%g ms, r/s=%g", dt * 1000.0, dt/n * 1000.0, n/dt);
}
tr.passIfNoException();
tr.ungroup();
}
示例4: userGetTest
static void userGetTest(Node& node, TestRunner& tr)
{
tr.group("user");
Messenger* messenger = node.getMessenger();
tr.test("get self (valid)");
{
// create url for obtaining users
Url url("/api/3.0/users/900");
// get user
User user;
assertNoException(
messenger->getSecureFromBitmunk(&url, user, node.getDefaultUserId()));
printf("\nUser:\n");
dumpDynamicObject(user, false);
}
tr.passIfNoException();
/*
tr.test("get non-self (valid)");
{
// create url for obtaining users
Url url("/api/3.0/users/900");
// get user
User user;
messenger->getSecureFromBitmunk(&url, user, node.getDefaultUserId());
assertNoException();
printf("\nUser:\n");
dumpDynamicObject(user, false);
}
tr.passIfNoException();
*/
tr.test("get identity (valid)");
{
// create url for obtaining identity
Url url("/api/3.0/users/identity/900");
// get identity
Identity identity;
assertNoException(
messenger->getSecureFromBitmunk(
&url, identity, node.getDefaultUserId()));
printf("\nIdentity:\n");
dumpDynamicObject(identity, false);
}
tr.passIfNoException();
/*
tr.test("get identity (invalid)");
{
// create url for obtaining identity
Url url("/api/3.0/users/identity/69766");
// get identity
Identity identity;
messenger->getSecureFromBitmunk((
&url, identity, node.getDefaultUserId());
assertException();
printf("\nIdentity:\n");
dumpDynamicObject(identity, false);
}
tr.passIfException();
*/
/*
tr.test("sellerKey");
{
// create url for obtaining users
Url url("/api/3.0/users/keys/seller/900");
// get user
DynamicObject sellerKey;
messenger->getFromBitmunk(&url, sellerKey);
assertNoException();
printf("\nSeller Key:\n");
dumpDynamicObject(sellerKey, false);
}
tr.passIfNoException();
tr.test("friends");
{
Url url("/api/3.0/friends/?user=900");
// get friends
User user;
messenger->getSecureFromBitmunk(&url, user, node.getDefaultUserId());
assertNoException();
printf("\nUser Friends:\n");
dumpDynamicObject(user, false);
}
//.........这里部分代码省略.........