Skip to content

Commit

Permalink
- Set clone test in accordance with observation on generated AlarmPP
Browse files Browse the repository at this point in the history
example where freeing the source of a cloned value frees the clone.  Not
reproducible in the runtime library.
-  Addresses #87.
  • Loading branch information
Victor Bandur committed Apr 17, 2017
1 parent 4145e1a commit 1f2e216
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions c/vdmclib/src/test/ExpressionsSet_Tests.cpp
Expand Up @@ -938,6 +938,21 @@ TEST(Expression_Set, setPower)
vdmFree(res);
}

TEST(Expression_Set, setCloneFree)
{
TVP set1;
TVP set3;

vdm_gc_init();
set1 = newSetVar(1, newInt(1));
TVP set2 = vdmCloneGC(set1, &set2);
set3 = set2;
vdmFree(set1);
vdm_gc_shutdown();

EXPECT_TRUE(set2 == set3);
}



/*
Expand Down

0 comments on commit 1f2e216

Please sign in to comment.