Mercurial > dedupe
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TestHuffmanString.cpp Wed Sep 05 21:54:53 2012 +0200 @@ -0,0 +1,20 @@ +#include "HuffmanString.hpp" +#include "TestFramework.hpp" + +#include <QtCore/QDebug> + +BOOST_AUTO_TEST_CASE( TestSimple ) +{ + HuffmanSet set; + set.setCutoff(1); + + QList<HuffmanString> strList; + for (uint n = 0; n < 100; ++n) { + QString str = QString("test%1").arg(n); + strList << HuffmanString(str, &set); + for (uint i = 0; i <= n; ++i) { + QString str = QString("test%1").arg(i); + BOOST_REQUIRE_EQUAL(strList[i], str); + } + } +}
