view TestHuffmanString.cpp @ 22:d62f708ad88b

Cosmetics.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Wed, 05 Sep 2012 21:55:21 +0200
parents 3bcdb8bb6914
children bf3dce7fedcb
line wrap: on
line source

#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);
    }
  }
}