Added a basic Easy-test

This commit is contained in:
tastytea 2018-04-01 05:03:50 +02:00
parent 1bd9dbff30
commit 65bd76a5ce
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
/* This file is part of mastodon-cpp.
*/
#include <iostream>
#include <cstdint>
#include "mastodon-cpp.hpp"
#include "easy/easy.hpp"
#include "easy/status.hpp"
int main(int argc, char *argv[])
{
Mastodon::Easy test("botsin.space", "");
std::string answer;
std::uint16_t ret = test.get(Mastodon::API::v1::timelines_public,
{ { "limit", { "1" } } }, answer);
if (ret == 0)
{
Mastodon::Easy::Status status(answer);
if (status.valid())
{
return 0;
}
}
std::cout << ret << ": " << answer << '\n';
return 1;
}