Skip to content

Commit

Permalink
Add test cases for tuple emplace
Browse files Browse the repository at this point in the history
  • Loading branch information
P-p-H-d committed Nov 25, 2023
1 parent 9dc582c commit b16048a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test-mtuple.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ static void check_swap(void)
pair_str_clear(p2);
}

static void check_emplace(void)
{
pair_str_t p1;
pair_str_init (p1);

pair_str_emplace_vala(p1, "Hello");
pair_str_emplace_valb(p1, "World");
assert(string_equal_str_p (p1->vala, "Hello"));
assert(string_equal_str_p (p1->valb, "World"));

pair_str_clear(p1);
}

static void check_reset(void)
{
single_str_t p1;
Expand Down Expand Up @@ -286,6 +299,7 @@ int main(void)
check_io();
check_swap();
check_reset();
check_emplace();
check_chaining_tuple();
test_double();
testobj_final_check();
Expand Down

0 comments on commit b16048a

Please sign in to comment.