Fix genetic algorithms CI failure

This commit is contained in:
Marenz 2022-01-12 16:30:04 +01:00
parent 0004ad8764
commit 57d84c8bfb
13 changed files with 15 additions and 12 deletions

View File

@ -1,4 +1,4 @@
int[L] constant L = 6; int[L] constant L = 6;
// ---- // ----
// TypeError 5462: (4-5): Invalid array length, expected integer literal or constant expression. // TypeError 5462: (4-5): Invalid array length, expected integer literal or constant expression.
// TypeError 9259: (0-21): Only constants of value type and byte arrays are implemented. // TypeError 9259: (0-21): Only constants of value type and byte array type are implemented.

View File

@ -3,4 +3,4 @@ contract C {
} }
// ---- // ----
// TypeError 5462: (21-22): Invalid array length, expected integer literal or constant expression. // TypeError 5462: (21-22): Invalid array length, expected integer literal or constant expression.
// TypeError 9259: (17-38): Only constants of value type and byte arrays are implemented. // TypeError 9259: (17-38): Only constants of value type and byte array type are implemented.

View File

@ -1,3 +1,3 @@
mapping(uint => uint) constant b = b; mapping(uint => uint) constant b = b;
// ---- // ----
// TypeError 9259: (0-36): Only constants of value type and byte arrays are implemented. // TypeError 9259: (0-36): Only constants of value type and byte array type are implemented.

View File

@ -1,4 +1,4 @@
struct S { uint x; } struct S { uint x; }
S constant s; S constant s;
// ---- // ----
// TypeError 9259: (21-33): Only constants of value type and byte arrays are implemented. // TypeError 9259: (21-33): Only constants of value type and byte array type are implemented.

View File

@ -5,4 +5,4 @@ contract C {
S public constant e = 0x1212121212121212121212121212121212121212; S public constant e = 0x1212121212121212121212121212121212121212;
} }
// ---- // ----
// TypeError 9259: (71-135): Only constants of value type and byte arrays are implemented. // TypeError 9259: (71-135): Only constants of value type and byte array type are implemented.

View File

@ -3,4 +3,4 @@ contract test {
} }
// ---- // ----
// DeclarationError 1788: (31-55): The "constant" keyword can only be used for state variables or variables at file level. // DeclarationError 1788: (31-55): The "constant" keyword can only be used for state variables or variables at file level.
// TypeError 9259: (31-55): Only constants of value type and byte arrays are implemented. // TypeError 9259: (31-55): Only constants of value type and byte array type are implemented.

View File

@ -2,4 +2,4 @@ contract C {
uint[3] constant x = [uint(1), 2, 3]; uint[3] constant x = [uint(1), 2, 3];
} }
// ---- // ----
// TypeError 9259: (17-53): Only constants of value type and byte arrays are implemented. // TypeError 9259: (17-53): Only constants of value type and byte array type are implemented.

View File

@ -3,4 +3,4 @@ contract C {
S constant x = S(5, new uint[](4)); S constant x = S(5, new uint[](4));
} }
// ---- // ----
// TypeError 9259: (52-86): Only constants of value type and byte arrays are implemented. // TypeError 9259: (52-86): Only constants of value type and byte array type are implemented.

View File

@ -1,4 +1,4 @@
S constant x; S constant x;
struct S { int y; } struct S { int y; }
// ---- // ----
// TypeError 9259: (0-12): Only constants of value type and byte arrays are implemented. // TypeError 9259: (0-12): Only constants of value type and byte array type are implemented.

View File

@ -2,4 +2,4 @@ contract C {
mapping(uint => uint) constant x; mapping(uint => uint) constant x;
} }
// ---- // ----
// TypeError 9259: (17-49): Only constants of value type and byte arrays are implemented. // TypeError 9259: (17-49): Only constants of value type and byte array type are implemented.

View File

@ -5,4 +5,4 @@ contract C {
S public constant c; S public constant c;
} }
// ---- // ----
// TypeError 9259: (71-90): Only constants of value type and byte arrays are implemented. // TypeError 9259: (71-90): Only constants of value type and byte array type are implemented.

View File

@ -3,4 +3,4 @@ contract Foo {
} }
// ---- // ----
// DeclarationError 1788: (30-55): The "constant" keyword can only be used for state variables or variables at file level. // DeclarationError 1788: (30-55): The "constant" keyword can only be used for state variables or variables at file level.
// TypeError 9259: (30-55): Only constants of value type and byte arrays are implemented. // TypeError 9259: (30-55): Only constants of value type and byte array type are implemented.

View File

@ -217,6 +217,9 @@ BOOST_FIXTURE_TEST_CASE(runNextRound_should_select_individuals_with_probability_
{ {
constexpr double relativeTolerance = 0.1; constexpr double relativeTolerance = 0.1;
constexpr size_t populationSize = 1000; constexpr size_t populationSize = 1000;
SimulationRNG::reset(1);
assert(populationSize % 4 == 0 && "Choose a number divisible by 4 for this test"); assert(populationSize % 4 == 0 && "Choose a number divisible by 4 for this test");
auto population = auto population =