Mercurial > dedupe
view TestHuffmanString.cpp @ 116:d2a7c0913ef1 default tip
Add project README
| author | Tom Fredrik Blenning <bfg@bfgconsult.no> |
|---|---|
| date | Wed, 20 May 2026 23:25:34 +0200 |
| parents | 7905fa8a3f1b |
| children |
line wrap: on
line source
#include "HuffmanString.hpp" #include "TestFramework.hpp" 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); } } } BOOST_AUTO_TEST_CASE( TestEmpty ) { HuffmanSet set; set.setCutoff(1); QString in_str(""); HuffmanString huff(in_str, &set); BOOST_REQUIRE_EQUAL(huff, in_str); }
