~albertog/libpspio/trunk

« back to all changes in this revision

Viewing changes to src/check_pspio_error.c

  • Committer: Micael Oliveira
  • Date: 2015-09-14 07:40:09 UTC
  • Revision ID: mjt.oliveira@ulg.ac.be-20150914074009-khnhzjt5kiky35wt
Bug fix: one test was trying to free memory that was not allocated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
void error_teardown(void)
39
39
{
40
40
  pspio_error_free();
41
 
  free(err_str);
42
41
}
43
42
 
44
43
START_TEST(test_error_fetch_all)
48
47
  ck_assert_str_eq(err_str, "libpspio: ERROR:\n"
49
48
          "  * in test_1_1.c(dummy1):1234:\n"
50
49
          "      value error: bad value found (PSPIO_EVALUE)\n");
 
50
  free(err_str);
51
51
}
52
52
END_TEST
53
53
 
58
58
 
59
59
  pspio_error_fetchall(&err_str);
60
60
  ck_assert(err_str == NULL);
 
61
  free(err_str);
61
62
 
62
63
  ck_assert_int_eq(pspio_error_get_last(NULL), PSPIO_SUCCESS);
63
64
  ck_assert_int_eq(pspio_error_len(), 0);
75
76
  ck_assert_str_eq(err_str, "libpspio: ERROR:\n"
76
77
          "  * in test_1_1.c(dummy1):1234:\n"
77
78
          "      value error: bad value found (PSPIO_EVALUE)\n");
 
79
  free(err_str);
78
80
 
79
81
  ck_assert(pspio_error_get_last(NULL) == PSPIO_SUCCESS);
80
82
  ck_assert(pspio_error_len() == 0);
97
99
          "      error in GSL (PSPIO_EGSL)\n"
98
100
          "  * in test_2_2.c(dummy22):202:\n"
99
101
          "      unsupported option in the pseudopotential file (PSPIO_ENOSUPPORT)\n");
 
102
  free(err_str);
 
103
 
100
104
  ck_assert(pspio_error_get_last(NULL) == PSPIO_SUCCESS);
101
105
  ck_assert(pspio_error_len() == 0);
102
106
}
127
131
          "      error (PSPIO_ERROR)\n", result);
128
132
  pspio_error_fetchall(&err_str);
129
133
  ck_assert_str_eq(err_str, result);
 
134
  free(err_str);
130
135
 
131
136
  ck_assert(pspio_error_get_last(NULL) == PSPIO_SUCCESS);
132
137
  ck_assert(pspio_error_len() == 0);