stdex/UnitTests/main.cpp
Simon Rozman 13703b1747 unicode: extend conversion with reusable charset_encoder
Windows takes care of internal converter state in MultiByteToWideChar
and WideCharToMultiByte and keeps them thread-safe. On other platforms,
iconv requires user to setup and keep converter state for thread-safe
conversions. This sounds time consuming for every string conversion,
therefore the concept of string converter (or converter state) has been
extended to Windows too, allowing uniform client code. On Windows, using
charset_encoder has no performance benefit, where on Linux and macOS,
there should be. To be measured...

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-14 12:28:05 +02:00

40 lines
862 B
C++

/*
SPDX-License-Identifier: MIT
Copyright © 2023 Amebis
*/
#include "pch.h"
#include "math.cpp"
#include "parser.cpp"
#include "ring.cpp"
#include "sgml.cpp"
#include "stream.cpp"
#include "unicode.cpp"
#include <iostream>
int main(int argc, const char * argv[])
{
try {
UnitTests::math::mul();
UnitTests::math::add();
UnitTests::parser::wtest();
UnitTests::parser::sgml_test();
UnitTests::parser::http_test();
UnitTests::ring::test();
UnitTests::sgml::sgml2wstr();
UnitTests::sgml::wstr2sgml();
UnitTests::stream::async();
UnitTests::stream::replicator();
UnitTests::stream::open_close();
UnitTests::unicode::str2wstr();
UnitTests::unicode::wstr2str();
UnitTests::unicode::charset_encoder();
std::cout << "PASS\n";
return 0;
}
catch (const std::exception& ex) {
std::cerr << ex.what() << " FAIL\n";
return 1;
}
}