I am going to prepare some test data for a compression test. One of the them is the 'worst case test', which should make the compressor work worst. Use random number to generate such a file is an idea, but there still contain some kind of patterns in the data. Using 7zip to compress such a file, I get a output file which is a little bit smaller than input file.
So I make a small piece of code to generate a file, which does not contain any repeated two bytes. To make life difficult, I shuffle those byte pairs in special order, hope the compressor will have more difficulty to find any match, even with predication.
#include <iostream>
#include <fstream>
int main(int argc, char* argv[])
{
    const char* filename = "c:\\_Test\\hard.dat";
    std::ofstream ofs(filename, std::ios::binary | std::ios::out);
    if (ofs.bad())
    {
        std::cerr << "fail to open file\n";
        return -1;
    }
    for (unsigned int i = 0; i < 0x10000; ++i)
    {
        unsigned int t = (i * 0xc369) & 0xFFFF;
        ofs.write((char*)&t, 2);
    }
    std::cout << "job done\n";
    return 0;
}
It's running in windows, and I think it's easy to change filename to make it work on other system, or even use command line argument as filename, but that's not the point.
I tried use 7zip to compress it, both format (7z and zip) created file bigger than original file. I have some other compressors, will test them later.
Any suggestions and help are appreciated.