File: pltest.cpp

package info (click to toggle)
paintlib 2.6.2-14
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 7,920 kB
  • ctags: 3,874
  • sloc: cpp: 25,209; sh: 10,605; ansic: 1,891; makefile: 120
file content (113 lines) | stat: -rw-r--r-- 2,384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
/--------------------------------------------------------------------
|
|      $Id: pltest.cpp,v 1.10 2004/09/11 14:15:38 uzadow Exp $
|
|      Copyright (c) 1996-2002 Ulrich von Zadow
|
\--------------------------------------------------------------------
*/

#include "pltest.h"
#include "pldebug.h"

#include <iostream>

using namespace std;

PLTest::PLTest(void)
: m_bOk(true),
  m_NumSucceeded(0),
  m_NumFailed(0)
{
}

PLTest::~PLTest(void)
{
}

// TODO: Make this into a macro that prints out the test that failed.
void PLTest::Test (bool b)
{
  if (b)
  {
    m_NumSucceeded++;
  }
  else
  {
    cerr << "           ---->> failed\n";
    m_bOk = false;
    m_NumFailed++;
  }
// Comment in to stop when a test fails
//  PLASSERT (b);
}


bool PLTest::IsOk ()
{
  return m_bOk;
}

void PLTest::SetFailed ()
{
  m_NumFailed++;
  m_bOk = false;
}

int PLTest::GetNumSucceeded () const
{
  return m_NumSucceeded;
}

int PLTest::GetNumFailed() const
{
  return m_NumFailed;
}

void PLTest::AggregateStatistics (const PLTest& ChildTest)
{
  m_NumSucceeded += ChildTest.GetNumSucceeded();
  m_NumFailed += ChildTest.GetNumFailed();
}

/*
/--------------------------------------------------------------------
|
|      $Log: pltest.cpp,v $
|      Revision 1.10  2004/09/11 14:15:38  uzadow
|      Comitted testimages, resized most of them.
|
|      Revision 1.9  2004/09/11 12:41:36  uzadow
|      removed plstdpch.h
|
|      Revision 1.8  2004/08/20 19:53:15  uzadow
|      no message
|
|      Revision 1.7  2003/02/24 22:10:35  uzadow
|      Linux version of MakeBmpFromURL() tests
|
|      Revision 1.6  2003/02/24 20:59:40  uzadow
|      Added windows url support, url support tests.
|
|      Revision 1.5  2002/10/20 22:11:53  uzadow
|      Partial doc update.
|      Fixed tests when images were not available.
|
|      Revision 1.4  2002/08/07 20:32:31  uzadow
|      Updated Makefile.in, fixed psd decoder layer stuff.
|
|      Revision 1.3  2002/08/06 20:13:37  uzadow
|      Cross-platform stuff.
|
|      Revision 1.2  2002/08/04 21:20:42  uzadow
|      no message
|
|      Revision 1.1  2002/08/04 20:12:34  uzadow
|      Added PLBmpInfo class, ability to extract metainformation from images without loading the whole image and proper greyscale support.
|      Major improvements in tests.
|
|
|
\--------------------------------------------------------------------
*/