9 if (a.size() == b.size()) {
10 for (
size_t i = 0; i < a.size(); ++i) {
21template<
typename T,
size_t N>
22bool compareArrays(
const std::array<T, N>& a,
const std::array<T, N>& b)
noexcept {
23 for (
size_t i = 0; i < N; ++i) {
34 constexpr bool input =
false;
46 constexpr U8 inputU8 = 2;
47 constexpr U16 inputU16 = 4;
48 constexpr U32 inputU32 = 6;
49 constexpr I8 inputI8 = -2;
50 constexpr I16 inputI16 = 40;
51 constexpr I32 inputI32 = -6;
52 constexpr F32 inputF32 = 3.45632f;
53 constexpr D64 inputD64 = 1.14159;
93TEST_CASE(
"ByteBuffer Simple Marker",
"[byte_buffer]" )
95 constexpr U16 testMarker[3]{ 444u, 555u, 777u };
97 constexpr U8 input = 122u;
100 test <<
string{
"StringTest Whatever" };
101 test <<
U32{ 123456u };
116 constexpr U16 testMarker[3]{ 444u, 555u, 777u };
119 test <<
string{
"StringTest Whatever" };
120 test <<
U32{ 123456u };
130 constexpr U16 testMarker[3]{ 444u, 555u, 777u };
133 test <<
string{
"StringTest Whatever" };
134 test <<
U32{ 123456u };
147 U16 testMarker[3]{ 444u, 555u, 777u };
150 test <<
string{
"StringTest Whatever" };
151 test <<
U32{ 123456u };
165 const string input =
"StringTest Whatever";
170 string output =
"Output";
178TEST_CASE(
"ByteBuffer RW Vector<Int>",
"[byte_buffer]" )
183 const vector<I32> input = { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 };
196 const vector<string> input = {
"-5",
"-4",
"-3",
"-2",
"-1",
"0",
"1",
"2",
"3",
"4",
"5" };
213 const std::array<I32, 11> input = { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 };
218 std::array<I32, 11> output{};
226 const std::array<string, 11> input = {
"-5",
"-4",
"-3",
"-2",
"-1",
"0",
"1",
"2",
"3",
"4",
"5" };
231 std::array<string, 11> output;
242 constexpr bool inputBool =
false;
243 const vector<I32> inputVectorInt = { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 };
244 const vector<string> inputVectorStr = {
"-5",
"-4",
"-3",
"-2",
"-1",
"0",
"1",
"2",
"3",
"4",
"5" };
245 constexpr std::array<I32, 11> inputArrayInt = {{ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 }};
246 const std::array<string, 11> inputArrayStr = {{
"-5",
"-4",
"-3",
"-2",
"-1",
"0",
"1",
"2",
"3",
"4",
"5" }};
247 constexpr U8 inputU8 = 2;
248 constexpr U16 inputU16 = 4;
249 constexpr U32 inputU32 = 6;
250 constexpr I8 inputI8 = -2;
251 constexpr I16 inputI16 = 40;
252 constexpr I32 inputI32 = -6;
253 constexpr F32 inputF32 = 3.45632f;
254 const string inputStr =
"StringTest Whatever";
255 constexpr D64 inputD64 = 1.14159;
257 bool outputBool =
true;
260 std::array<I32, 11> outputArrayInt{};
261 std::array<string, 11> outputArrayStr;
268 F32 outputF32 = 0.0f;
269 string outputStr =
"Output";
274 test << inputVectorInt;
275 test << inputVectorStr;
276 test << inputArrayInt;
277 test << inputArrayStr;
290 test >> outputVectorInt;
291 test >> outputVectorStr;
292 test >> outputArrayInt;
293 test >> outputArrayStr;
void readSkipToMarker(const T(&pattern)[N])
Skip (consume) everything in the buffer until we find the specified list of items....
void addMarker(const T(&pattern)[N])
Add a specific list of items in order to mark a special point in the buffer. Can be used for skipping...
bool bufferEmpty() const noexcept
Returns true if the read position and the write position are identical.
Handle console commands that start with a forward slash.
bool compareArrays(const std::array< T, N > &a, const std::array< T, N > &b) noexcept
eastl::vector< Type > vector
bool compareVectors(const vector< T > &a, const vector< T > &b)
bool COMPARE(T X, U Y) noexcept
TEST_CASE("ByteBuffer RW Bool", "[byte_buffer]")
#define CHECK_EQUAL(LHS, RHS)