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"><<a href="mailto:netterfield@astro.utoronto.ca">netterfield@astro.utoronto.ca</a>></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"><<a href="mailto:syntheticpp@gmx.net" target="_blank">syntheticpp@gmx.net</a>></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've accidentally committed the patch.<br>
Before reverting I wanna ask again if the original test<br>
didn'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>
> To fix the unit test for Histogram I need to call internalUpdate on GenerateVector once more:<br>
> 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>
> Is this the correct behaviour or a bug?<br>
><br>
> Peter<br>
><br>
> Index: tests/testhistogram.cpp<br>
> ===================================================================<br>
> --- tests/testhistogram.cpp (Revision 1214031)<br>
> +++ tests/testhistogram.cpp (Arbeitskopie)<br>
> @@ -30,8 +30,18 @@<br>
> void TestHistogram::testHistogram() {<br>
> Kst::GeneratedVectorPtr gvp = Kst::kst_cast<Kst::GeneratedVector>(_store.createObject<Kst::GeneratedVector>());<br>
> Q_ASSERT(gvp);<br>
> + QCOMPARE(gvp->length(), 1);<br>
> +<br>
> gvp->changeRange(0, 10, 100);<br>
> + QCOMPARE(gvp->max(), 0.0);<br>
> + QCOMPARE(gvp->length(), 100);<br>
> +<br>
> + gvp->internalUpdate();<br>
> + QCOMPARE(gvp->max(), 10.0);<br>
> + QCOMPARE(gvp->length(), 100);<br>
> +<br>
> Kst::VectorPtr vp(gvp);<br>
> + QCOMPARE(vp->max(), 10.0);<br>
><br>
> Kst::HistogramPtr h1 = Kst::kst_cast<Kst::Histogram>(_store.createObject<Kst::Histogram>());<br>
> h1->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>