Permalink
Browse files

Correct variable reference usage in tests and test cleanup

  • Loading branch information...
1 parent c454e88 commit 034ff09907cced80249062cf11890250237995e0 @dajobe committed May 9, 2012
@@ -1154,8 +1154,11 @@ main(int argc, char *argv[])
v = rasqal_variables_table_get_by_name(vt, RASQAL_VARIABLE_TYPE_NORMAL,
var_name);
- if(v)
+ /* returns SHARED pointer to variable */
+ if(v) {
+ v = rasqal_new_variable_from_variable(v);
l = rasqal_new_variable_literal(world, v);
+ }
if(l)
e = rasqal_new_literal_expression(world, l);
@@ -205,7 +205,9 @@ main(int argc, char *argv[])
failures++;
goto tidy;
}
-
+
+ rasqal_free_row(row); row = NULL;
+
rasqal_free_rowsource(rowsource);
/* re-init rowsource */
@@ -229,6 +231,8 @@ main(int argc, char *argv[])
tidy:
+ if(row)
+ rasqal_free_row(row);
if(seq)
raptor_free_sequence(seq);
if(rowsource)
@@ -776,8 +776,11 @@ main(int argc, char *argv[])
v = rasqal_variables_table_get_by_name(vt, RASQAL_VARIABLE_TYPE_NORMAL,
var_name);
- if(v)
+ /* returns SHARED pointer to variable */
+ if(v) {
+ v = rasqal_new_variable_from_variable(v);
l = rasqal_new_variable_literal(world, v);
+ }
if(l)
e = rasqal_new_literal_expression(world, l);
@@ -362,9 +362,10 @@ main(int argc, char *argv[])
(raptor_data_print_handler)rasqal_variable_print);
for(i = 0 ; i < EXPECTED_COLUMNS_COUNT; i++) {
rasqal_variable* v;
- unsigned const char* name=(unsigned const char*)project_1_var_names[i];
+ unsigned const char* name = (unsigned const char*)project_1_var_names[i];
v = rasqal_variables_table_get_by_name(vt, RASQAL_VARIABLE_TYPE_NORMAL,
name);
+ /* returns SHARED pointer to variable */
if(v) {
v = rasqal_new_variable_from_variable(v);
raptor_sequence_push(projection_seq, v);

0 comments on commit 034ff09

Please sign in to comment.