MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / TEST

Function TEST

Engine/source/core/util/test/tFixedSizeDequeTest.cpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include "core/util/tFixedSizeDeque.h"
26
27TEST(FixedSizeDeque, FixedSizeDeque)
28{
29 enum { DEQUE_SIZE = 3 };
30 FixedSizeDeque< U32 > deque( DEQUE_SIZE );
31
32 EXPECT_EQ( deque.capacity(), DEQUE_SIZE );
33 EXPECT_EQ( deque.size(), 0 );
34
35 deque.pushFront( 1 );
36 EXPECT_EQ( deque.capacity(), ( DEQUE_SIZE - 1 ) );
37 EXPECT_EQ( deque.size(), 1 );
38 EXPECT_FALSE( deque.isEmpty() );
39
40 deque.pushBack( 2 );
41 EXPECT_EQ( deque.capacity(), ( DEQUE_SIZE - 2 ) );
42 EXPECT_EQ( deque.size(), 2 );
43
44 EXPECT_EQ( deque.popFront(), 1 );
45 EXPECT_EQ( deque.popFront(), 2 );
46 EXPECT_TRUE( deque.isEmpty() );
47};
48
49#endif

Callers

nothing calls this directly

Calls 6

capacityMethod · 0.45
sizeMethod · 0.45
pushFrontMethod · 0.45
isEmptyMethod · 0.45
pushBackMethod · 0.45
popFrontMethod · 0.45

Tested by

no test coverage detected