Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
TestAssertList.cpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
16#include "TestAssertList.hpp"
19#include <sstream>
20#include <vector>
21
22namespace shamtest::details {
23
25 std::string acc = "\n[\n";
26
27 for (u32 i = 0; i < asserts.size(); i++) {
29 if (i < asserts.size() - 1) {
30 acc += ",";
31 }
32 }
33
34 acc += "\n]";
35 return acc;
36 }
37
38 void TestAssertList::serialize(std::basic_stringstream<byte> &stream) {
40 }
41
42 TestAssertList TestAssertList::deserialize(std::basic_stringstream<byte> &stream) {
43 std::vector<TestAssert> tmp;
45 return {std::move(tmp)};
46 }
47
48} // namespace shamtest::details
std::uint32_t u32
32 bit unsigned integer
void stream_read_vector(std::basic_stringstream< byte > &stream, std::vector< T > &vec)
read a vector from the bytestream Note : this appends read objects to the vector without resetting it
std::string increase_indent(std::string in, std::string delim="\n ")
Increase indentation of a string.
Definition string.hpp:197
void stream_write_vector(std::basic_stringstream< byte > &stream, std::vector< T > &vec)
write the vector into the bytestream
implementation details of the test library
Definition DataNode.hpp:23
Class to hold the list of assertion related to a test.
static TestAssertList deserialize(std::basic_stringstream< byte > &reader)
DeSerialize the assertion from binary format.
void serialize(std::basic_stringstream< byte > &stream)
Serialize the assertion in binary format.
std::string serialize_json()
Serialize the assertion in JSON.
std::vector< TestAssert > asserts
List of assertion held by the class.