flexible syntax

This commit is contained in:
fraillt
2017-09-25 13:02:12 +03:00
parent f0508025f6
commit ab5cc8a2c0
29 changed files with 960 additions and 383 deletions

View File

@@ -145,7 +145,7 @@ struct IntegralUnsignedTypes {
TEST(BufferEndianness, WhenBufferValueTypeIs1ByteThenBitOperationsIsNotAffectedByEndianness) {
//fill initial values
static_assert(sizeof(bitsery::details::BufferContainerTraits<DefaultConfig::BufferType>::TValue) == 1, "currently only 1 byte size, value size is supported");
static_assert(sizeof(bitsery::details::ContainerTraits<DefaultConfig::BufferType>::TValue) == 1, "currently only 1 byte size, value size is supported");
//fill initial values
constexpr IntegralUnsignedTypes src {
0x0000334455667788,//bits 19

View File

@@ -22,6 +22,7 @@
#include <gmock/gmock.h>
#include "serialization_test_utils.h"
#include <bitsery/traits/string.h>
using testing::Eq;
using bitsery::BufferWriter;

View File

@@ -24,6 +24,8 @@
#include <bitsery/buffer_writer.h>
#include <bitsery/buffer_reader.h>
#include <bitsery/details/serialization_common.h>
#include <bitsery/traits/array.h>
#include <bitsery/traits/vector.h>
using testing::Eq;
using testing::ContainerEq;

View File

@@ -25,9 +25,12 @@
#include <gmock/gmock.h>
#include <algorithm>
#include <numeric>
#include <deque>
#include <list>
// #include <deque>
#include "serialization_test_utils.h"
#include <bitsery/traits/array.h>
#include <bitsery/traits/list.h>
#include <bitsery/traits/deque.h>
using testing::ContainerEq;

View File

@@ -26,7 +26,7 @@
#include <bitsery/ext/container_map.h>
#include <bitsery/ext/entropy.h>
#include <unordered_map>
#include <map>
#include <bitsery/traits/string.h>
using ContainerMap = bitsery::ext::ContainerMap;

View File

@@ -24,8 +24,7 @@
#include <gmock/gmock.h>
#include "serialization_test_utils.h"
#include <bitsery/ext/entropy.h>
#include <vector>
#include <list>
#include <bitsery/traits/list.h>
using namespace testing;

View File

@@ -29,7 +29,6 @@ using namespace testing;
using bitsery::ext::Growable;
using Buffer = typename bitsery::DefaultConfig::BufferType;
using DiffType = typename bitsery::details::BufferContainerTraits<Buffer>::TDifference;
struct DataV1 {
int32_t v1;

View File

@@ -23,6 +23,8 @@
#include <gmock/gmock.h>
#include "serialization_test_utils.h"
#include <bitsery/traits/string.h>
#include <bitsery/traits/array.h>
using testing::Eq;
using testing::StrEq;

View File

@@ -23,6 +23,8 @@
#include <gmock/gmock.h>
#include "serialization_test_utils.h"
#include <bitsery/traits/string.h>
using namespace testing;
TEST(SerializeText, BasicString) {
@@ -113,6 +115,5 @@ TEST(SerializeText, WhenCArrayNotNullterminatedThenAssert) {
char16_t t1[CARR_LENGTH]{u"some text"};
//make last character not nullterminated
t1[CARR_LENGTH-1] = 'x';
EXPECT_DEATH(ctx.createSerializer().text<2>(t1), "");
}