Skip to content
Snippets Groups Projects
Commit ccf810ce authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Disabling randomized when on unit tests

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