Implémentation de RipplingMath.h
[GPU.git] / WCudaMSE / API_CppTest / SRC / core / utils.cpp
1 // ---
2 //
3 // $Id: utils.cpp,v 1.5 2008/07/15 20:33:31 hartwork Exp $
4 //
5 // CppTest - A C++ Unit Testing Framework
6 // Copyright (c) 2003 Niklas Lundell
7 //
8 // ---
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the
22 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 // Boston, MA 02111-1307, USA.
24 //
25 // ---
26
27
28 #if (defined(__WIN32__) || defined(WIN32))
29 # include "winconfig.h"
30 #else
31 # include "config.h"
32 #endif
33
34 #include "missing.h"
35 #include "utils.h"
36
37 namespace Test
38 {
39 // Computes the procentage of correct tests.
40 //
41 int
42 correct(int tests, int errors)
43 {
44 if ((errors == 0) || (tests == 0))
45 return 100;
46
47 return (tests - errors) * 100 / tests;
48 }
49
50 } // namespace Test