Skip to content

Commit

Permalink
Cover atomic increase of ref count
Browse files Browse the repository at this point in the history
  • Loading branch information
atilaneves committed Sep 22, 2023
1 parent 3227669 commit a89ed6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/ut/ref_counted.d
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ mixin TestUtils;
@("default.struct.shared")
@system unittest {
{
auto ptr = RefCounted!(shared SharedStruct)(5);
auto ptr0 = RefCounted!(shared SharedStruct)(5);
SharedStruct.numStructs.shouldEqual(1);
auto ptr2 = ptr0; // copying the pointer ups the ref count but not # of structs
SharedStruct.numStructs.should == 1;
}
SharedStruct.numStructs.shouldEqual(0);
}
Expand Down

0 comments on commit a89ed6f

Please sign in to comment.