Skip to content

Commit 2b7c6e3

Browse files
author
James Foster
committed
Add comments describing test.
1 parent e323378 commit 2b7c6e3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

SampleProjects/TestSomething/test/clientServer.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ unittest(Client) {
2020
}
2121

2222
unittest(Client_copy_constructor) {
23-
Client client1;
24-
Client client2;
25-
client2 = client1;
26-
assertTrue(true);
23+
{ // Client object contains a reference to a String object
24+
Client c1; // Constructor instantiates a String (s1)
25+
Client c2; // Constructor instantiates a String (s2)
26+
c2 = c1; // Does c2 get a reference to s1 or a copy of it?
27+
} // End of scope calls destructor on c1 and c2
28+
assertTrue(true); // Was s1 deleted once (with c1) or twice (also with c2)?
29+
// Was s2 deleted at all (should be during assignment)?
2730
}
2831

2932
unittest(IPAddress) {

0 commit comments

Comments
 (0)