Ex-wife testifies in child porn trial