Skip to content

Commit cc9fa12

Browse files
committed
test:improve coverage of brick
Signed-off-by: hanen mizouni <[email protected]>
1 parent 4f5739b commit cc9fa12

File tree

2 files changed

+217
-94
lines changed

2 files changed

+217
-94
lines changed

src/brick.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ uint32_t pg_brick_links_count_get(const struct pg_brick *brick,
325325
const struct pg_brick *target,
326326
struct pg_error **errp)
327327
{
328-
uint32_t count = 0;
328+
int count = 0;
329329
enum pg_side i;
330330
const struct pg_brick_side *side;
331331

332332
if (!brick) {
333333
*errp = pg_error_new("brick is NULL");
334-
return 0;
334+
return -1;
335335
}
336336

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

0 commit comments

Comments
 (0)