<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 29, 2013 at 8:54 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div dir="ltr">
<div><div><div>Hello,<br><br></div>i tried to implement a simple algorithm to find nearest common roots for some object(s).. <br></div>see the attached code.<br><br></div>The problem i discovered that the last assertion of my test fails:<br>

=====<br>testArrayShouldBeRootOfItsElements<br><br>    | obj1 obj2 array arrayToTest roots |<br>    <br>    obj1 := &#39;ObjectA&#39; copy.<br>    obj2 := &#39;ObjectB&#39; copy.<br>    <br>    array := {  obj1. obj2 }.<br>

    arrayToTest := { obj1. obj2 }.<br>    <br>    roots := CommonRootsFinder new findCommonRootsOf:  arrayToTest.<br>    <br>    self assert: (roots identityIncludes: array).<br>    self assert: (roots identityIncludes: arrayToTest) not.<br>

    self assert: (roots identityIncludes: thisContext).  &quot;- sometimes works , sometimes not &quot;<br clear="all"><div><div><div><div>========<br><br></div><div>but, when i restart the method in debugger and step down through it, assertion DOES NOT fails.<br>

</div><div>This means that memory scan does not reveals this context as it should be.<br><br></div><div>(maybe because it stops at the object which located before location of thisContext)?<br></div></div></div></div></div>
</blockquote><div><br></div><div>That would make sense.  For debugging, why don&#39;t you record the objects visited in an OrderedCollection, and then you can look at what order the pointer finder found them.</div><div> </div>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
<div><div><div><div></div><div><br></div><div>any suggestions/comments/ideas , how to make sure that assert will never fail?<br></div></div></div></div></div></blockquote><div><br></div><div>Doesn&#39;t that depend on how you&#39;ve implemented CommonRootsFinder?</div>
<div><br></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div>
<br></div><div>-- <br>Best regards,<br>Igor Stasenko.
</div></div></div></div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>