comparison TestHuffmanString.cpp @ 21:3bcdb8bb6914

Huffman representations.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Wed, 05 Sep 2012 21:54:53 +0200
parents
children bf3dce7fedcb
comparison
equal deleted inserted replaced
20:754e12c927b3 21:3bcdb8bb6914
1 #include "HuffmanString.hpp"
2 #include "TestFramework.hpp"
3
4 #include <QtCore/QDebug>
5
6 BOOST_AUTO_TEST_CASE( TestSimple )
7 {
8 HuffmanSet set;
9 set.setCutoff(1);
10
11 QList<HuffmanString> strList;
12 for (uint n = 0; n < 100; ++n) {
13 QString str = QString("test%1").arg(n);
14 strList << HuffmanString(str, &set);
15 for (uint i = 0; i <= n; ++i) {
16 QString str = QString("test%1").arg(i);
17 BOOST_REQUIRE_EQUAL(strList[i], str);
18 }
19 }
20 }