@@ -423,14 +423,17 @@ static void test_CFL_format_clear_format(void) {
423423
424424 // NULL Matrix
425425 GrB_Matrix old_base = A .base ;
426- GrB_Matrix old_base_row = A .base ;
426+ GrB_Matrix old_base_row = A .base_row ;
427+ GrB_Matrix old_base_col = A .base_col ;
427428 A .base = NULL ;
428429 A .base_row = NULL ;
430+ A .base_col = NULL ;
429431 GrB_Info result = matrix_clear_format (& A , OPT_FORMAT );
430432 OK (!result );
431433
432434 A .base = old_base ;
433435 A .base_row = old_base_row ;
436+ A .base_col = old_base_col ;
434437 CFL_matrix_free (& A );
435438
436439 teardown ();
@@ -455,14 +458,17 @@ static void test_CFL_format_dup_format(void) {
455458
456459 // NULL Matrix
457460 GrB_Matrix old_base = A .base ;
458- GrB_Matrix old_base_row = A .base ;
461+ GrB_Matrix old_base_row = A .base_row ;
462+ GrB_Matrix old_base_col = A .base_col ;
459463 A .base = NULL ;
460464 A .base_row = NULL ;
465+ A .base_col = NULL ;
461466 GrB_Info result = matrix_dup_format (& A , & B , OPT_FORMAT );
462467 OK (!result );
463468
464469 A .base = old_base ;
465470 A .base_row = old_base_row ;
471+ A .base_col = old_base_col ;
466472 CFL_matrix_free (& A );
467473 CFL_matrix_free (& B );
468474
@@ -471,6 +477,8 @@ static void test_CFL_format_dup_format(void) {
471477 B = CFL_matrix_create (5 , 5 );
472478 OK (matrix_to_format (& A , GrB_COLMAJOR , true));
473479 OK (matrix_dup_format (& A , & B , 0 ));
480+ CFL_matrix_free (& A );
481+ CFL_matrix_free (& B );
474482
475483 teardown ();
476484#endif
@@ -488,6 +496,10 @@ static void test_CFL_format_mxm_second_greather_then_k(void) {
488496 OK (CFL_mxm (& C , & A , & B , false, false, OPT_FORMAT ));
489497 TEST_CHECK (C .nvals == 0 );
490498
499+ free_matrix (& A );
500+ free_matrix (& B );
501+ free_matrix (& C );
502+
491503 teardown ();
492504#endif
493505}
@@ -505,12 +517,15 @@ static void test_CFL_format_wise_when_both(void) {
505517
506518 // NULL Matrix
507519 GrB_Matrix old_base = A .base ;
508- GrB_Matrix old_base_row = A .base ;
520+ GrB_Matrix old_base_row = A .base_row ;
521+ GrB_Matrix old_base_col = A .base_col ;
509522 A .base = NULL ;
510523 A .base_row = NULL ;
524+ A .base_col = NULL ;
511525 GrB_Info result = CFL_wise (& A , & A , & B , false, OPT_FORMAT );
512526 A .base = old_base ;
513527 A .base_row = old_base_row ;
528+ A .base_col = old_base_col ;
514529 OK (!result );
515530
516531 CFL_matrix_free (& A );
@@ -680,6 +695,9 @@ static void test_CFL_empty_rsub_both_empty(void) {
680695 OK (CFL_rsub (& A , & B , OPT_EMPTY ));
681696 TEST_CHECK (A .nvals == 0 );
682697
698+ free_matrix (& A );
699+ free_matrix (& B );
700+
683701 teardown ();
684702#endif
685703}
@@ -700,6 +718,8 @@ static void test_CFL_lazy_create(void) {
700718 TEST_CHECK (A .is_lazy == true);
701719 TEST_CHECK (A .nvals == 0 );
702720
721+ free_matrix (& A );
722+
703723 teardown ();
704724#endif
705725}
@@ -737,6 +757,8 @@ static Matrix make_lazy_matrix(size_t base_matrices_count) {
737757 GrB_Matrix _result ;
738758 GrB_Matrix_new (& _result , GrB_BOOL , n , n );
739759 Matrix result = CFL_matrix_from_base_lazy (_result );
760+ GrB_free (& _result );
761+ result .base = NULL ;
740762
741763 result .is_lazy = true;
742764 result .base_matrices_count = base_matrices_count ;
@@ -1010,6 +1032,9 @@ static void test_CFL_block_dup(void) {
10101032
10111033 OK (CFL_dup (& B , & A , OPT_BLOCK ));
10121034 TEST_CHECK (B .nvals == A .nvals );
1035+
1036+ free_matrix (& A );
1037+ free_matrix (& B );
10131038 }
10141039
10151040 {
@@ -1018,6 +1043,9 @@ static void test_CFL_block_dup(void) {
10181043
10191044 OK (CFL_dup (& B , & A , OPT_BLOCK ));
10201045 TEST_CHECK (B .nvals == A .nvals );
1046+
1047+ free_matrix (& A );
1048+ free_matrix (& B );
10211049 }
10221050
10231051 {
@@ -1026,6 +1054,9 @@ static void test_CFL_block_dup(void) {
10261054
10271055 OK (CFL_dup (& B , & A , OPT_BLOCK ));
10281056 TEST_CHECK (B .nvals == A .nvals );
1057+
1058+ free_matrix (& A );
1059+ free_matrix (& B );
10291060 }
10301061
10311062 {
@@ -1034,6 +1065,9 @@ static void test_CFL_block_dup(void) {
10341065
10351066 OK (CFL_dup (& B , & A , OPT_BLOCK ));
10361067 TEST_CHECK (B .nvals == A .nvals );
1068+
1069+ free_matrix (& A );
1070+ free_matrix (& B );
10371071 }
10381072
10391073 teardown ();
@@ -1114,16 +1148,17 @@ static void test_CFL_block_hyper_rotate(void) {
11141148 GrB_Matrix _A ;
11151149 GrB_Matrix_new (& _A , GrB_BOOL , 20 * 20 , 20 );
11161150 Matrix A = CFL_matrix_from_base_lazy (_A );
1151+ GrB_free (& _A );
11171152
11181153 GrB_Matrix _A0 ;
11191154 GrB_Matrix_new (& _A0 , GrB_BOOL , 20 * 20 , 20 );
11201155 Matrix A0 = CFL_matrix_from_base (_A0 );
11211156 GrB_Matrix _A1 ;
11221157 GrB_Matrix_new (& _A1 , GrB_BOOL , 20 * 20 , 20 );
1123- Matrix A1 = CFL_matrix_from_base (_A0 );
1158+ Matrix A1 = CFL_matrix_from_base (_A1 );
11241159 GrB_Matrix _A2 ;
11251160 GrB_Matrix_new (& _A2 , GrB_BOOL , 20 * 20 , 20 );
1126- Matrix A2 = CFL_matrix_from_base (_A0 );
1161+ Matrix A2 = CFL_matrix_from_base (_A2 );
11271162
11281163 A .base_matrices [0 ] = A0 ;
11291164 A .base_matrices [1 ] = A1 ;
@@ -1135,9 +1170,9 @@ static void test_CFL_block_hyper_rotate(void) {
11351170 TEST_CHECK (A .ncols == 20 * 20 );
11361171
11371172 free_matrix (& A );
1138- free_matrix (& A0 );
1139- free_matrix (& A1 );
1140- free_matrix (& A2 );
1173+ // free_matrix(&A0);
1174+ // free_matrix(&A1);
1175+ // free_matrix(&A2);
11411176 }
11421177
11431178 // cell
0 commit comments