Commit ccf810ce authored by incardon's avatar incardon

Disabling randomized when on unit tests

parent d267a896
...@@ -73,6 +73,8 @@ if test x"$mem_check" = x"yes"; then ...@@ -73,6 +73,8 @@ if test x"$mem_check" = x"yes"; then
AC_DEFINE([MEMLEAK_CHECK],[],[Memory check]) AC_DEFINE([MEMLEAK_CHECK],[],[Memory check])
fi fi
AC_DEFINE([ON_IO_UNIT_TESTS],[],[IO unit tests])
##### CHECK FOR BOOST ############## ##### CHECK FOR BOOST ##############
AX_BOOST([1.52],[],[]) AX_BOOST([1.52],[],[])
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Author: Pietro Incardona * Author: Pietro Incardona
*/ */
#include "config.h"
#ifndef UTIL_HPP_ #ifndef UTIL_HPP_
#define UTIL_HPP_ #define UTIL_HPP_
...@@ -67,86 +69,80 @@ struct RGB getColor(int group, std::uniform_real_distribution<float> & d, std::d ...@@ -67,86 +69,80 @@ struct RGB getColor(int group, std::uniform_real_distribution<float> & d, std::d
{ {
struct RGB col; struct RGB col;
float s = d(g);
#ifdef ON_IO_UNIT_TESTS
s = 0.5;
#endif
if (group == 0) if (group == 0)
{ {
float s = d(g);
col.R = s/2 + 0.5; col.R = s/2 + 0.5;
col.G = 0.0; col.G = 0.0;
col.B = 0.0; col.B = 0.0;
} }
else if (group == 1) else if (group == 1)
{ {
float s = d(g);
col.R = 0.0; col.R = 0.0;
col.G = s/2 + 0.5; col.G = s/2 + 0.5;
col.B = 0.0; col.B = 0.0;
} }
else if (group == 2) else if (group == 2)
{ {
float s = d(g);
col.R = 0.0; col.R = 0.0;
col.G = 0.0; col.G = 0.0;
col.B = s; col.B = s;
} }
else if (group == 3) else if (group == 3)
{ {
float s = d(g);
col.R = s/2 + 0.5; col.R = s/2 + 0.5;
col.G = s/2 + 0.5; col.G = s/2 + 0.5;
col.B = 0.0; col.B = 0.0;
} }
else if (group == 4) else if (group == 4)
{ {
float s = d(g);
col.R = s/2 + 0.5; col.R = s/2 + 0.5;
col.G = 0.0; col.G = 0.0;
col.B = s/2 + 0.5; col.B = s/2 + 0.5;
} }
else if (group == 5) else if (group == 5)
{ {
float s = d(g);
col.R = 0.0; col.R = 0.0;
col.G = s/2 + 0.5; col.G = s/2 + 0.5;
col.B = s/2 + 0.5; col.B = s/2 + 0.5;
} }
else if (group == 6) else if (group == 6)
{ {
float s = d(g);
col.R = s/2 + 0.5; col.R = s/2 + 0.5;
col.G = s/4 + 0.5; col.G = s/4 + 0.5;
col.B = 0.0; col.B = 0.0;
} }
else if (group == 7) else if (group == 7)
{ {
float s = d(g);
col.R = s/4 + 0.5; col.R = s/4 + 0.5;
col.G = s/2 + 0.5; col.G = s/2 + 0.5;
col.B = 0.0; col.B = 0.0;
} }
else if (group == 8) else if (group == 8)
{ {
float s = d(g);
col.R = 0.0; col.R = 0.0;
col.G = s/2 + 0.5; col.G = s/2 + 0.5;
col.B = s/4 + 0.5; col.B = s/4 + 0.5;
} }
else if (group == 9) else if (group == 9)
{ {
float s = d(g);
col.R = 0.0; col.R = 0.0;
col.G = s/4 + 0.5; col.G = s/4 + 0.5;
col.B = s/2 + 0.5; col.B = s/2 + 0.5;
} }
else if (group == 10) else if (group == 10)
{ {
float s = d(g);
col.R = s/4 + 0.5; col.R = s/4 + 0.5;
col.G = 0.0; col.G = 0.0;
col.B = s/2 + 0.5; col.B = s/2 + 0.5;
} }
else if (group == 11) else if (group == 11)
{ {
float s = d(g);
col.R = s/2 + 0.5; col.R = s/2 + 0.5;
col.G = 0.0; col.G = 0.0;
col.B = s/4 + 0.5; col.B = s/4 + 0.5;
......
...@@ -129,17 +129,17 @@ CELL_TYPES 12 ...@@ -129,17 +129,17 @@ CELL_TYPES 12
11 11
CELL_DATA 12 CELL_DATA 12
COLOR_SCALARS data 4 COLOR_SCALARS data 4
0.500004 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.565769 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.877803 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.729325 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.766384 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.609480 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.000000 0.523522 0.000000 1.0 0.000000 0.750000 0.000000 1.0
0.000000 0.839432 0.000000 1.0 0.000000 0.750000 0.000000 1.0
0.000000 0.839648 0.000000 1.0 0.000000 0.750000 0.000000 1.0
0.000000 0.967346 0.000000 1.0 0.000000 0.750000 0.000000 1.0
0.000000 0.691751 0.000000 1.0 0.000000 0.750000 0.000000 1.0
0.000000 0.759708 0.000000 1.0 0.000000 0.750000 0.000000 1.0
...@@ -68,10 +68,10 @@ CELL_TYPES 6 ...@@ -68,10 +68,10 @@ CELL_TYPES 6
11 11
CELL_DATA 6 CELL_DATA 6
COLOR_SCALARS data 4 COLOR_SCALARS data 4
0.500004 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.565769 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.877803 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.729325 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.766384 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.609480 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
...@@ -44,10 +44,10 @@ CELL_TYPES 6 ...@@ -44,10 +44,10 @@ CELL_TYPES 6
8 8
CELL_DATA 6 CELL_DATA 6
COLOR_SCALARS data 4 COLOR_SCALARS data 4
0.500004 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.565769 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.877803 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.729325 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.766384 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
0.609480 0.000000 0.000000 1.0 0.750000 0.000000 0.000000 1.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment