Files
thehub/testing/hub/main.cpp
T
tomFlowee b5b493542b Rework base58 and tests
The unit tests testing base58 encoding were using univalue JSON
parsing, since we deprecatd univalue to be a hub-private lib
this has now been ported to Qts JSON parser.
Which also makes the clunky cmake hack nice to replace with the
QRC files concept.

As I was in there anyway, the base58 methods being global scope
C-style methods has now been fixed by putting them in a namespace.
2022-12-13 11:34:54 +01:00

79 lines
1.9 KiB
C++

/*
* This file is part of the Flowee project
* Copyright (C) 2018-2021 Tom Zander <tom@flowee.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "blocksdb_tests.h"
#include "base58_tests.h"
#include "MetaBlock_tests.h"
#include "address_manager_tests.h"
#include "univalue_tests.h"
int main(int x, char**y)
{
/*
QCoreApplication app(x, y);
QFile block("block");
block.open(QIODevice::ReadOnly);
auto d = block.readAll();
QFile out("blockdata");
out.open(QIODevice::WriteOnly);
bool even = false;
uint8_t byte = 0;
for (uint8_t k : d) {
if (k <= '9')
k -= '0';
else
k = k + 10 - 'a';
if (even) {
byte += k;
char buf[1];
buf[0] = byte;
out.write(buf, 1);
} else {
byte = k << 4;
}
even = !even;
}
return 0;
*/
int rc = 0;
{
TestBlocksDB test;
rc = QTest::qExec(&test);
}
if (!rc) {
TestMetaBlock test;
rc = QTest::qExec(&test);
}
if (!rc) {
TestAddrMan test;
rc = QTest::qExec(&test);
}
if (!rc) {
TestUnivalue test;
rc = QTest::qExec(&test);
}
if (!rc) {
Base58Tests test;
rc = QTest::qExec(&test);
}
return rc;
}