[Kst] Re: histogram unit test
Barth Netterfield
netterfield at astro.utoronto.ca
Mon Jan 17 17:54:21 CET 2011
It looks like there was a genuine bug in generatedVector which you
uncovered. I will look into it further.
On Sun, Jan 16, 2011 at 10:20 AM, Peter Kümmel <syntheticpp at gmx.net> wrote:
> In the meantime I've accidentally committed the patch.
> Before reverting I wanna ask again if the original test
> didn't disclosed a bug.
>
> Peter
>
>
> On 12.01.2011 20:50, Peter Kuemmel wrote:
> > To fix the unit test for Histogram I need to call internalUpdate on
> GenerateVector once more:
> > 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.
> > Is this the correct behaviour or a bug?
> >
> > Peter
> >
> > Index: tests/testhistogram.cpp
> > ===================================================================
> > --- tests/testhistogram.cpp (Revision 1214031)
> > +++ tests/testhistogram.cpp (Arbeitskopie)
> > @@ -30,8 +30,18 @@
> > void TestHistogram::testHistogram() {
> > Kst::GeneratedVectorPtr gvp =
> Kst::kst_cast<Kst::GeneratedVector>(_store.createObject<Kst::GeneratedVector>());
> > Q_ASSERT(gvp);
> > + QCOMPARE(gvp->length(), 1);
> > +
> > gvp->changeRange(0, 10, 100);
> > + QCOMPARE(gvp->max(), 0.0);
> > + QCOMPARE(gvp->length(), 100);
> > +
> > + gvp->internalUpdate();
> > + QCOMPARE(gvp->max(), 10.0);
> > + QCOMPARE(gvp->length(), 100);
> > +
> > Kst::VectorPtr vp(gvp);
> > + QCOMPARE(vp->max(), 10.0);
> >
> > Kst::HistogramPtr h1 =
> Kst::kst_cast<Kst::Histogram>(_store.createObject<Kst::Histogram>());
> > h1->change(vp, 0, 10, 10, Kst::Histogram::Number);
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>
--
C. Barth Netterfield
University of Toronto
416-845-0946
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kst/attachments/20110117/b6305c26/attachment.htm
More information about the Kst
mailing list