OK.  The test, as modified by Peter, is now correct.  Objects need internalUpdate() to be run before changes are fully propagated.  In kst2, they are done from the update manager only.  In the tests they need to be done by hand.<div>
<br></div><div>There is an issue in kst, however: if we are paused, no updates happen.  So changes to objects, even through dialogs,  while we are paused, do not fully propagate.  This is probably a bug.</div><div><div><br>
<div class="gmail_quote">On Mon, Jan 17, 2011 at 11:54 AM, Barth Netterfield <span dir="ltr">&lt;<a href="mailto:netterfield@astro.utoronto.ca">netterfield@astro.utoronto.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
It looks like there was a genuine bug in generatedVector which you uncovered.  I will look into it further.<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Sun, Jan 16, 2011 at 10:20 AM, Peter Kümmel <span dir="ltr">&lt;<a href="mailto:syntheticpp@gmx.net" target="_blank">syntheticpp@gmx.net</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In the meantime I&#39;ve accidentally committed the patch.<br>
Before reverting I wanna ask again if the original test<br>
didn&#39;t disclosed a bug.<br>
<font color="#888888"><br>
Peter<br>
</font><div><br>
<br>
On 12.01.2011 20:50, Peter Kuemmel wrote:<br>
&gt; To fix the unit test for Histogram I need to call internalUpdate on GenerateVector once more:<br>
&gt; before the update changeRange is called, the new length is active (10) but the values not (max==0), the values only have after the internalUpdate the new values (max==10), see the adition QCOMPAREs.<br>
&gt; Is this the correct behaviour or a bug?<br>
&gt;<br>
&gt; Peter<br>
&gt;<br>
&gt; Index: tests/testhistogram.cpp<br>
&gt; ===================================================================<br>
&gt; --- tests/testhistogram.cpp   (Revision 1214031)<br>
&gt; +++ tests/testhistogram.cpp   (Arbeitskopie)<br>
&gt; @@ -30,8 +30,18 @@<br>
&gt;   void TestHistogram::testHistogram() {<br>
&gt;     Kst::GeneratedVectorPtr gvp = Kst::kst_cast&lt;Kst::GeneratedVector&gt;(_store.createObject&lt;Kst::GeneratedVector&gt;());<br>
&gt;     Q_ASSERT(gvp);<br>
&gt; +  QCOMPARE(gvp-&gt;length(), 1);<br>
&gt; +<br>
&gt;     gvp-&gt;changeRange(0, 10, 100);<br>
&gt; +  QCOMPARE(gvp-&gt;max(), 0.0);<br>
&gt; +  QCOMPARE(gvp-&gt;length(), 100);<br>
&gt; +<br>
&gt; +  gvp-&gt;internalUpdate();<br>
&gt; +  QCOMPARE(gvp-&gt;max(), 10.0);<br>
&gt; +  QCOMPARE(gvp-&gt;length(), 100);<br>
&gt; +<br>
&gt;     Kst::VectorPtr vp(gvp);<br>
&gt; +  QCOMPARE(vp-&gt;max(), 10.0);<br>
&gt;<br>
&gt;     Kst::HistogramPtr h1 = Kst::kst_cast&lt;Kst::Histogram&gt;(_store.createObject&lt;Kst::Histogram&gt;());<br>
&gt;     h1-&gt;change(vp, 0, 10, 10, Kst::Histogram::Number);<br>
</div><div><div></div><div>_______________________________________________<br>
Kst mailing list<br>
<a href="mailto:Kst@kde.org" target="_blank">Kst@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kst" target="_blank">https://mail.kde.org/mailman/listinfo/kst</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(136, 136, 136)">C. Barth Netterfield<br>
University of Toronto<br>
416-845-0946</span><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(136, 136, 136)"><br></span></div><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(136, 136, 136)">C. Barth Netterfield<br>University of Toronto<br>416-845-0946</span><div>
<span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(136, 136, 136)"><br></span></div><br>
</div></div>