Skip to content

Commit

Permalink
test:improve coverage of brick
Browse files Browse the repository at this point in the history
Signed-off-by: hanen mizouni <[email protected]>
  • Loading branch information
outscale-hmi committed Jan 15, 2020
1 parent 99e6bc6 commit b6d0ef5
Show file tree
Hide file tree
Showing 2 changed files with 306 additions and 92 deletions.
5 changes: 3 additions & 2 deletions src/brick.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@ uint32_t pg_brick_links_count_get(const struct pg_brick *brick,
const struct pg_brick *target,
struct pg_error **errp)
{
uint32_t count = 0;
int count = 0;
enum pg_side i;
const struct pg_brick_side *side;

if (!brick) {
*errp = pg_error_new("brick is NULL");
return 0;
return -1;
}

if (brick->type == PG_MULTIPOLE) {
Expand All @@ -349,6 +349,7 @@ uint32_t pg_brick_links_count_get(const struct pg_brick *brick,
if (side->edge.link && side->edge.link == target)
++count;
} else {
*errp = pg_error_new("brick config type is unknown");
return -1;
}

Expand Down
Loading

0 comments on commit b6d0ef5

Please sign in to comment.