MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / test_string

Method test_string

extern/libcds/test/unit/queue/fcqueue.cpp:87–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86 template <class Queue>
87 void test_string( Queue& q )
88 {
89 std::string str[3];
90 str[0] = "one";
91 str[1] = "two";
92 str[2] = "three";
93 const size_t nSize = sizeof( str ) / sizeof( str[0] );
94
95 // move push
96 for ( size_t i = 0; i < nSize; ++i ) {
97 std::string s = str[i];
98 ASSERT_FALSE( s.empty());
99 ASSERT_TRUE( q.enqueue( std::move( s )));
100 ASSERT_FALSE( s.empty());
101 ASSERT_EQ( q.size(), i + 1 );
102 }
103 ASSERT_FALSE( q.empty());
104 ASSERT_EQ( q.size(), nSize );
105
106 for ( size_t i = 0; i < nSize; ++i ) {
107 std::string s;
108 ASSERT_TRUE( q.pop( s ));
109 ASSERT_EQ( q.size(), nSize - i - 1 );
110 ASSERT_EQ( s, str[i] );
111 }
112 ASSERT_TRUE( q.empty());
113 ASSERT_EQ( q.size(), 0u );
114 }
115
116 template <class Queue>
117 void test_heavy( Queue& q )

Callers

nothing calls this directly

Calls 5

moveFunction · 0.50
emptyMethod · 0.45
enqueueMethod · 0.45
sizeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected