dct: move test code in a main scope