ArithmeticCoding  0.0.0a
Arithmetic coding in C
Classes | Defines | Typedefs | Functions
C:/Users/clackn/Desktop/src/arithcode/test/stream.cc File Reference
#include <gtest/gtest.h>
#include "stream.h"

Go to the source code of this file.

Classes

class  StreamSanityTest
class  TypedStreamSanityTest< T >
class  TypedStreamCarryTest< T >

Defines

#define DEFN_PUSH(a, b)   template<> void push<a>(stream_t *s, a v) { push_##b(s,v); }
#define DEFN_POP(a, b)   template<> a pop(stream_t *s) { return pop_##b(s); }
#define DEFN_CARRY(a, b)   template<> void carry<a> (stream_t *s) { carry_##b(s); }

Typedefs

typedef testing::Types
< uint8_t, uint16_t, uint32_t,
uint64_t, int8_t, int16_t,
int32_t, int64_t > 
RegularTypes
typedef testing::Types
< uint8_t, uint16_t, uint32_t > 
CarryTypes

Functions

template<class T >
void push (stream_t *s, T v)
 DEFN_PUSH (uint8_t, u8)
 DEFN_PUSH (uint16_t, u16)
 DEFN_PUSH (uint32_t, u32)
 DEFN_PUSH (uint64_t, u64)
 DEFN_PUSH (int8_t, i8)
 DEFN_PUSH (int16_t, i16)
 DEFN_PUSH (int32_t, i32)
 DEFN_PUSH (int64_t, i64)
template<class T >
pop (stream_t *s)
 DEFN_POP (uint8_t, u8)
 DEFN_POP (uint16_t, u16)
 DEFN_POP (uint32_t, u32)
 DEFN_POP (uint64_t, u64)
 DEFN_POP (int8_t, i8)
 DEFN_POP (int16_t, i16)
 DEFN_POP (int32_t, i32)
 DEFN_POP (int64_t, i64)
template<class T >
void carry (stream_t *s)
 DEFN_CARRY (uint8_t, u8)
 DEFN_CARRY (uint16_t, u16)
 DEFN_CARRY (uint32_t, u32)
 TEST (Attach, NullBuffer)
 TEST (Attach, ExistingBuffer)
 TEST_F (StreamSanityTest, PushU1)
 TEST_F (StreamSanityTest, PushU4)
 TEST_F (StreamSanityTest, PushU8)
 TYPED_TEST_CASE (TypedStreamSanityTest, RegularTypes)
 TYPED_TEST (TypedStreamSanityTest, PushPop)
 TEST_F (StreamSanityTest, PushPopU1)
 TEST_F (StreamSanityTest, PushPopU4)
 TYPED_TEST_CASE (TypedStreamCarryTest, CarryTypes)
 TYPED_TEST (TypedStreamCarryTest, Carry)
 TEST_F (StreamSanityTest, CarryU1)
 TEST_F (StreamSanityTest, CarryU4)

Define Documentation

#define DEFN_CARRY (   a,
 
)    template<> void carry<a> (stream_t *s) { carry_##b(s); }

Definition at line 34 of file stream.cc.

#define DEFN_POP (   a,
 
)    template<> a pop(stream_t *s) { return pop_##b(s); }

Definition at line 22 of file stream.cc.

#define DEFN_PUSH (   a,
 
)    template<> void push<a>(stream_t *s, a v) { push_##b(s,v); }

Definition at line 10 of file stream.cc.


Typedef Documentation

typedef testing::Types< uint8_t, uint16_t, uint32_t > CarryTypes

Definition at line 205 of file stream.cc.

typedef testing::Types< uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t > RegularTypes

Definition at line 146 of file stream.cc.


Function Documentation

template<class T >
void carry ( stream_t s)
DEFN_CARRY ( uint8_t  ,
u8   
)
DEFN_CARRY ( uint16_t  ,
u16   
)
DEFN_CARRY ( uint32_t  ,
u32   
)
DEFN_POP ( uint8_t  ,
u8   
)
DEFN_POP ( uint16_t  ,
u16   
)
DEFN_POP ( uint32_t  ,
u32   
)
DEFN_POP ( uint64_t  ,
u64   
)
DEFN_POP ( int8_t  ,
i8   
)
DEFN_POP ( int16_t  ,
i16   
)
DEFN_POP ( int32_t  ,
i32   
)
DEFN_POP ( int64_t  ,
i64   
)
DEFN_PUSH ( uint8_t  ,
u8   
)
DEFN_PUSH ( uint16_t  ,
u16   
)
DEFN_PUSH ( uint32_t  ,
u32   
)
DEFN_PUSH ( uint64_t  ,
u64   
)
DEFN_PUSH ( int8_t  ,
i8   
)
DEFN_PUSH ( int16_t  ,
i16   
)
DEFN_PUSH ( int32_t  ,
i32   
)
DEFN_PUSH ( int64_t  ,
i64   
)
template<class T >
T pop ( stream_t s)
template<class T >
void push ( stream_t s,
v 
)
TEST ( Attach  ,
NullBuffer   
)

Definition at line 42 of file stream.cc.

TEST ( Attach  ,
ExistingBuffer   
)

Definition at line 60 of file stream.cc.

TEST_F ( StreamSanityTest  ,
PushU1   
)

Definition at line 93 of file stream.cc.

TEST_F ( StreamSanityTest  ,
PushU4   
)

Definition at line 111 of file stream.cc.

TEST_F ( StreamSanityTest  ,
PushU8   
)

Definition at line 123 of file stream.cc.

TEST_F ( StreamSanityTest  ,
PushPopU1   
)

Definition at line 166 of file stream.cc.

TEST_F ( StreamSanityTest  ,
PushPopU4   
)

Definition at line 181 of file stream.cc.

TEST_F ( StreamSanityTest  ,
CarryU1   
)

Definition at line 228 of file stream.cc.

TEST_F ( StreamSanityTest  ,
CarryU4   
)

Definition at line 248 of file stream.cc.

TYPED_TEST ( TypedStreamSanityTest  ,
PushPop   
)

Definition at line 152 of file stream.cc.

TYPED_TEST ( TypedStreamCarryTest  ,
Carry   
)

Definition at line 209 of file stream.cc.

 All Classes Files Functions Variables Typedefs Defines