~ubuntu-branches/ubuntu/karmic/kst/karmic

« back to all changes in this revision

Viewing changes to kst/tests/testhistogram.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-06-30 19:11:30 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060630191130-acumuar75bz4puty
Tags: 1.2.1-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
  KST::dataObjectList.append(h1.data());
40
40
  doTest(h1->propertyString() == "Histogram: V1");
41
41
  doTest(!h1->realTimeAutoBin()); // should be false by default
42
 
  doTest(h1->type() == KST_HISTOGRAM);
43
42
  doTest(h1->nBins() == 10);
 
43
  h1->update(0);
44
44
  doTest(h1->vMin() == 0.0);
45
45
  doTest(h1->vMax() == 10.0);
46
46
  doTest(h1->vNumSamples() == 100);
47
 
  h1->update(0);
48
47
  int count = 0;
49
48
  for (int i=0; i<10; i++) {
50
49
    count += int(h1->vY()->value(i));
80
79
  doTest(count == 100); // should still account for the whole vector
81
80
  // min > max
82
81
  h1 = new KstHistogram("H2", vp, 10, 0, 10, KST_HS_NUMBER);
83
 
  doTest(h1->type() == KST_HISTOGRAM);
84
82
  doTest(h1->nBins() == 10);
85
83
  doTest(h1->xMin() == 0.0);
86
84
  doTest(h1->xMax() == 10.0);
89
87
  doTest(h1->vNumSamples() == 100);
90
88
  // min == max
91
89
  h1 = new KstHistogram("H3", vp, 10, 10, 2, KST_HS_NUMBER);
92
 
  doTest(h1->type() == KST_HISTOGRAM);
93
90
  doTest(h1->nBins() == 2);
94
91
  doTest(h1->xMin() == 9.0);
95
92
  doTest(h1->xMax() == 11.0);
98
95
  doTest(h1->vNumSamples() == 100);
99
96
  // max < min
100
97
  h1 = new KstHistogram("H4", vp, 11, 9, 1, KST_HS_NUMBER);
101
 
  doTest(h1->type() == KST_HISTOGRAM);
102
98
  doTest(h1->nBins() == 2);
103
99
  doTest(h1->xMax()==11);
104
100
  doTest(h1->xMin()==9);