I am developing a Qt project with Qt creator, all works fine, but when i came to the unit testing part using QTest, after compilation I get the error "Invalid parameter passed to C run-time function".
Can anyone help me to find the source of the problem?
Is it due to the use of cstdio
functions or has it something to do with the .pro
configuration?
This is a test method I implemented and did not work:
void TestFichier::testLoad()
{
Fichier a;
a.load("input.txt");
FILE *f=fopen("input.txt","rb");
int c;
int i,*tab=a.getHexValues();
for (i=0;i<3;i++)
c=fgetc(f);
fclose(f);
QCOMPARE(tab[2],c);
}
Fichier is a class I created with a method load
.