It looks like there was a genuine bug in generatedVector which you uncovered. I will look into it further.<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">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 class="im"><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 class="h5">_______________________________________________<br>
Kst mailing list<br>
<a href="mailto:Kst@kde.org">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>-- <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>