A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use C++11 <random> instead of rand().
[simgrid.git]
/
teshsuite
/
mc
/
dwarf-expression
/
dwarf-expression.cpp
diff --git
a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp
b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp
index
8dfb552
..
a3c143f
100644
(file)
--- a/
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
+++ b/
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
@@
-11,6
+11,7
@@
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cstdlib>
#include <cstring>
+#include <random>
#include "src/mc/mc_private.hpp"
#include "src/mc/mc_private.hpp"
@@
-19,6
+20,8
@@
#include "src/mc/Variable.hpp"
#include "src/mc/remote/RemoteClient.hpp"
#include "src/mc/Variable.hpp"
#include "src/mc/remote/RemoteClient.hpp"
+static std::default_random_engine rnd_engine;
+
static simgrid::mc::RemoteClient* process;
static
static simgrid::mc::RemoteClient* process;
static
@@
-51,8
+54,8
@@
void basic_test(simgrid::dwarf::ExpressionContext const& state) {
Dwarf_Op ops[60];
Dwarf_Op ops[60];
- uintptr_t a = r
and
();
- uintptr_t b = r
and
();
+ uintptr_t a = r
nd_engine
();
+ uintptr_t b = r
nd_engine
();
simgrid::dwarf::ExpressionStack stack;
simgrid::dwarf::ExpressionStack stack;
@@
-161,26
+164,26
@@
int main(int argc, char** argv) {
basic_test(state);
for(int i=0; i!=100; ++i) {
basic_test(state);
for(int i=0; i!=100; ++i) {
- uintptr_t a = r
and
();
- uintptr_t b = r
and
();
+ uintptr_t a = r
nd_engine
();
+ uintptr_t b = r
nd_engine
();
assert(eval_binary_operation(state, DW_OP_plus, a, b) == (a + b));
}
for(int i=0; i!=100; ++i) {
assert(eval_binary_operation(state, DW_OP_plus, a, b) == (a + b));
}
for(int i=0; i!=100; ++i) {
- uintptr_t a = r
and
();
- uintptr_t b = r
and
();
+ uintptr_t a = r
nd_engine
();
+ uintptr_t b = r
nd_engine
();
assert(eval_binary_operation(state, DW_OP_or, a, b) == (a | b));
}
for(int i=0; i!=100; ++i) {
assert(eval_binary_operation(state, DW_OP_or, a, b) == (a | b));
}
for(int i=0; i!=100; ++i) {
- uintptr_t a = r
and
();
- uintptr_t b = r
and
();
+ uintptr_t a = r
nd_engine
();
+ uintptr_t b = r
nd_engine
();
assert(eval_binary_operation(state, DW_OP_and, a, b) == (a & b));
}
for(int i=0; i!=100; ++i) {
assert(eval_binary_operation(state, DW_OP_and, a, b) == (a & b));
}
for(int i=0; i!=100; ++i) {
- uintptr_t a = r
and
();
- uintptr_t b = r
and
();
+ uintptr_t a = r
nd_engine
();
+ uintptr_t b = r
nd_engine
();
assert(eval_binary_operation(state, DW_OP_xor, a, b) == (a ^ b));
}
assert(eval_binary_operation(state, DW_OP_xor, a, b) == (a ^ b));
}