Do bulk replace of stl types.
This commit is contained in:
parent
521486be62
commit
c25a56ee19
531 changed files with 2274 additions and 2181 deletions
|
@ -9,8 +9,8 @@ TEST_CASE(TestHuffmanCodeLengthTable, "compression")
|
|||
{
|
||||
HuffmanCodeLengthTable table;
|
||||
|
||||
std::vector<std::pair<unsigned, unsigned char> > mappings {{144, 8}, {112, 9}, {24, 7}, {8 ,8}};
|
||||
std::vector<unsigned char> code_length_sequence;
|
||||
Vector<std::pair<unsigned, unsigned char> > mappings {{144, 8}, {112, 9}, {24, 7}, {8 ,8}};
|
||||
Vector<unsigned char> code_length_sequence;
|
||||
for(const auto& entry : mappings)
|
||||
{
|
||||
for(unsigned idx=0;idx<entry.first;idx++)
|
||||
|
@ -37,7 +37,7 @@ TEST_CASE(TestHuffmanCodeLengthTable, "compression")
|
|||
|
||||
TEST_CASE(TestLiteralsTable, "compression")
|
||||
{
|
||||
std::vector<unsigned char> lengths = {7,4,4,7,5,5,7,7,6,6,7,6,6,6,8,6,6,8,
|
||||
Vector<unsigned char> lengths = {7,4,4,7,5,5,7,7,6,6,7,6,6,6,8,6,6,8,
|
||||
6,6,7,6,8,7,7,7,7,7,7,6,6,7,7,6,6,7,7,8,8,7,7,7,6,6,7,7,7,7,6,7,7,7,
|
||||
7,7,7,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
|
@ -65,7 +65,7 @@ TEST_CASE(TestLiteralsTable, "compression")
|
|||
}
|
||||
|
||||
HuffmanCodeLengthTable codingTable;
|
||||
std::vector<unsigned char> coding_lengths{4, 0, 6, 7, 3, 2, 4, 2, 7, 4, 6, 3, 0, 6, 0, 0, 0, 0, 0};
|
||||
Vector<unsigned char> coding_lengths{4, 0, 6, 7, 3, 2, 4, 2, 7, 4, 6, 3, 0, 6, 0, 0, 0, 0, 0};
|
||||
codingTable.setInputLengthSequence(coding_lengths, true);
|
||||
codingTable.buildPrefixCodes();
|
||||
|
||||
|
@ -78,7 +78,7 @@ TEST_CASE(TestLiteralsTable, "compression")
|
|||
out_stream.writeNBits(10, 4);
|
||||
|
||||
/*
|
||||
std::vector<unsigned char> permuted(19, 0);
|
||||
Vector<unsigned char> permuted(19, 0);
|
||||
static constexpr unsigned DEFLATE_PERMUTATION[19]{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
||||
unsigned count = 0;
|
||||
for (auto length : coding_lengths)
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
TEST_CASE(TestLz77Encoder, "compression")
|
||||
{
|
||||
std::vector<unsigned> values {0, 10, 11, 12, 10, 11, 12, 0, 13, 14, 15, 10, 11, 12};
|
||||
Vector<unsigned> values {0, 10, 11, 12, 10, 11, 12, 0, 13, 14, 15, 10, 11, 12};
|
||||
|
||||
//std::vector<unsigned> values {0, 1, 2, 3, 0, 1, 2, 3, 0,1};
|
||||
//Vector<unsigned> values {0, 1, 2, 3, 0, 1, 2, 3, 0,1};
|
||||
|
||||
BufferBitStream input_stream;
|
||||
for (auto value : values)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
TEST_CASE(TestRunLengthEncoder, "compression")
|
||||
{
|
||||
std::string test_data = "BCAAAADDDCCACACAC";
|
||||
String test_data = "BCAAAADDDCCACACAC";
|
||||
|
||||
RunLengthEncoder encoder;
|
||||
auto encoded = encoder.encode(StringUtils::toBytes(test_data));
|
||||
|
@ -25,8 +25,8 @@ TEST_CASE(TestRunLengthEncoder, "compression")
|
|||
|
||||
TEST_CASE(TestHuffmanEncoder, "compression")
|
||||
{
|
||||
//std::string testData = "BCAADDDCCACACAC";
|
||||
//std::vector<unsigned char> stream(testData.begin(), testData.end());
|
||||
//String testData = "BCAADDDCCACACAC";
|
||||
//Vector<unsigned char> stream(testData.begin(), testData.end());
|
||||
|
||||
std::unordered_map<unsigned char, unsigned> counts;
|
||||
counts['A'] = 1;
|
||||
|
@ -44,8 +44,8 @@ TEST_CASE(TestHuffmanEncoder, "compression")
|
|||
|
||||
TEST_CASE(TestLz77Encoder, "compression")
|
||||
{
|
||||
std::string test_data = "sir sid eastman easily teases sea sick seals";
|
||||
//std::string test_data = "sir sid eastman";
|
||||
String test_data = "sir sid eastman easily teases sea sick seals";
|
||||
//String test_data = "sir sid eastman";
|
||||
|
||||
BufferBitStream input_stream;
|
||||
input_stream.setBuffer(StringUtils::toBytes(test_data));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue