+Sat Oct 14 16:21:45 2006 Ben Pfaff <blp@gnu.org>
+
+ * casefile-test.c: (test_casereader_clone) Free cases that we
+ read, to avoid memory leak.
+
Tue Jun 6 18:48:00 2006 Ben Pfaff <blp@gnu.org>
* casefile-test.c: (test_casefile) Test the new casereader_seek()
/* Read a 3rd of the cases */
for ( i = 0 ; i < case_cnt / 3 ; ++i )
- casereader_read (reader1, &c1);
+ {
+ casereader_read (reader1, &c1);
+ case_destroy (&c1);
+ }
clone = casereader_clone (reader1);
/* Copy all the cases into a new file */
while( casereader_read (reader1, &c1))
{
- casefile_append (newfile, &c1);
+ casefile_append_xfer (newfile, &c1);
cases ++;
}
cases --;
if ( ! casereader_read_xfer (newreader, &c2) )
- break;
+ {
+ case_destroy (&c1);
+ break;
+ }
v1 = case_data_all (&c1) ;
v2 = case_data_all (&c2) ;
if ( 0 != memcmp (v1, v2, value_cnt * MAX_SHORT_STRING))
fail_test ("Cloned reader read different value at case %ld", cases);
+
+ case_destroy (&c1);
+ case_destroy (&c2);
}
if ( cases > 0 )