Skip to content

Commit

Permalink
ovn-test: Fix 'test-ovn composition' crash
Browse files Browse the repository at this point in the history
Without this fix, the added test will core dump.

Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
azhou-nicira committed Oct 20, 2016
1 parent 2eb98b6 commit 42d36b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ ct_state = NXM_NX_CT_STATE
]])
AT_CLEANUP

AT_SETUP([ovn -- compsition])
AT_CHECK([ovstest test-ovn composition 2], [0], [ignore])
AT_CLEANUP

AT_SETUP([ovn -- expression parser])
dnl For lines without =>, input and expected output are identical.
dnl For lines with =>, input precedes => and expected output follows =>.
Expand Down
4 changes: 2 additions & 2 deletions tests/test-ovn.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,11 @@ next_composition(unsigned int *state, int s[], int sn)
j++;
} else {
j--;
s[j] = s[j + 1];
s[j - 1]++;
if (!j) {
return 0;
}
s[j] = s[j + 1];
s[j - 1]++;
}
}
return j + 1;
Expand Down

0 comments on commit 42d36b5

Please sign in to comment.