1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-25 13:41:56 +03:00

moved from Catch to doctest for unit tests

This commit is contained in:
onqtam
2019-01-13 18:41:21 +02:00
parent e5753b14a8
commit 2f44ac1def
52 changed files with 5517 additions and 11854 deletions

View File

@ -27,12 +27,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "catch.hpp"
#include "doctest_compatibility.h"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>
#include <sstream>
#include <iomanip>
#include <set>
class SaxCountdown
{
@ -1345,7 +1348,7 @@ TEST_CASE("single MessagePack roundtrip")
}
TEST_CASE("MessagePack roundtrips", "[hide]")
TEST_CASE("MessagePack roundtrips" * doctest::skip())
{
SECTION("input from msgpack-python")
{
@ -1519,8 +1522,8 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
{
CAPTURE(filename)
SECTION(filename + ": std::vector<uint8_t>")
{
INFO_WITH_TEMP(filename + ": std::vector<uint8_t>");
// parse JSON file
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
@ -1537,8 +1540,8 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
CHECK(j1 == j2);
}
SECTION(filename + ": std::ifstream")
{
INFO_WITH_TEMP(filename + ": std::ifstream");
// parse JSON file
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
@ -1552,8 +1555,8 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
CHECK(j1 == j2);
}
SECTION(filename + ": uint8_t* and size")
{
INFO_WITH_TEMP(filename + ": uint8_t* and size");
// parse JSON file
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
@ -1570,8 +1573,8 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
CHECK(j1 == j2);
}
SECTION(filename + ": output to output adapters")
{
INFO_WITH_TEMP(filename + ": output to output adapters");
// parse JSON file
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
@ -1584,8 +1587,8 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
if (!exclude_packed.count(filename))
{
SECTION(filename + ": output adapters: std::vector<uint8_t>")
{
INFO_WITH_TEMP(filename + ": output adapters: std::vector<uint8_t>");
std::vector<uint8_t> vec;
json::to_msgpack(j1, vec);
CHECK(vec == packed);