Skip to content

Commit

Permalink
add more cases to CRCR operator
Browse files Browse the repository at this point in the history
  • Loading branch information
FanWuUCL committed Oct 22, 2015
1 parent 5c378c9 commit 910ece7
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/mutators/selective_c/CRCR/integer_constant_replacement.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Mutator * mutator_milu_integer_constant_replacement()
mut->node_checking = & mutator_milu_integer_constant_replacement_node_checking;
mut->mutate = & mutator_milu_integer_constant_replacement_mutate;
mut->clean = & mutator_milu_integer_constant_replacement_clean;
mut->size = 5;
mut->size = 9;
return mut;
}

Expand Down Expand Up @@ -86,6 +86,30 @@ static gboolean mutator_milu_integer_constant_replacement_mutate(ASTNode * node,
// case 6:
// set_ASTNode_text (node, g_strdup_printf("%d", atoi(node->text) * -1));
// return TRUE;
case 6:
if(atoi(node->text) != 15)
set_ASTNode_text (node, "15");
else
set_ASTNode_text (node, "16");
return TRUE;
case 7:
if(atoi(node->text) != 255)
set_ASTNode_text (node, "255");
else
set_ASTNode_text (node, "256");
return TRUE;
case 8:
if(atoi(node->text) != 1023)
set_ASTNode_text (node, "1023");
else
set_ASTNode_text (node, "1024");
return TRUE;
case 9:
if(atoi(node->text) != 32767)
set_ASTNode_text (node, "32767");
else
set_ASTNode_text (node, "32768");
return TRUE;
default:
break;
}
Expand Down

0 comments on commit 910ece7

Please sign in to comment.