summaryrefslogtreecommitdiffstats
path: root/document/src/tests/testbytebuffer.h
blob: d7dfc835d3c1380ecb3481736ecdc184a672d357 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/* $Id$*/

#pragma once

#include <cppunit/extensions/HelperMacros.h>

/**
   CPPUnit test case for ByteBuffer class.
*/
class ByteBuffer_Test : public CppUnit::TestFixture {
    CPPUNIT_TEST_SUITE( ByteBuffer_Test);
    CPPUNIT_TEST(test_constructors);
    CPPUNIT_TEST(test_copy_constructor);
    CPPUNIT_TEST(test_assignment_operator);
    CPPUNIT_TEST(test_slice);
    CPPUNIT_TEST(test_slice2);
    CPPUNIT_TEST(test_putGetFlip);
    CPPUNIT_TEST(test_NumberEncodings);
    CPPUNIT_TEST(test_NumberLengths);
    CPPUNIT_TEST(test_SerializableArray);
    CPPUNIT_TEST_SUITE_END();

public:
  /**
     Initialization.
  */
  void setUp() override;

protected:
    /**
       Test construction and deletion.
    */
    void test_constructors();
    void test_SerializableArray();

    /**
       Test copy constructor
    */
    void test_copy_constructor();
    /**
       Test construction and deletion.
    */
    void test_assignment_operator();

    /**
       Test the slice() method
    */
    void test_slice();

    /**
       Test the slice2() method
    */
    void test_slice2();

    /**
       Test put(), get() and flip() methods.
    */
    void test_putGetFlip();

    /**
       Test writing integers with funny encodings.
    */
    void test_NumberEncodings();

    /**
       Tests lengths of those encodings.
    */
    void test_NumberLengths();

};