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
New question: Valgrind spits tons of errors
[simgrid.git]
/
examples
/
simdag
/
sd_test.c
diff --git
a/examples/simdag/sd_test.c
b/examples/simdag/sd_test.c
index
b287d57
..
a54db33
100644
(file)
--- a/
examples/simdag/sd_test.c
+++ b/
examples/simdag/sd_test.c
@@
-13,6
+13,8
@@
int main(int argc, char **argv) {
/* initialisation of SD */
SD_init(&argc, argv);
/* initialisation of SD */
SD_init(&argc, argv);
+ /* xbt_log_control_set("sd.thres=debug"); */
+
if (argc < 2) {
INFO1("Usage: %s platform_file", argv[0]);
INFO1("example: %s sd_platform.xml", argv[0]);
if (argc < 2) {
INFO1("Usage: %s platform_file", argv[0]);
INFO1("example: %s sd_platform.xml", argv[0]);
@@
-70,32
+72,42
@@
int main(int argc, char **argv) {
TRY {
SD_task_dependency_add(NULL, NULL, taskA, taskA); /* shouldn't work and must raise an exception */
TRY {
SD_task_dependency_add(NULL, NULL, taskA, taskA); /* shouldn't work and must raise an exception */
- xbt_
assert0(0,
"Hey, I can add a dependency between Task A and Task A!");
+ xbt_
die(
"Hey, I can add a dependency between Task A and Task A!");
}
CATCH (ex) {
}
CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW; /* this is a serious error */
+ xbt_ex_free(ex);
}
TRY {
}
TRY {
- SD_task_dependency_add(NULL, NULL, task
A, taskB
); /* shouldn't work and must raise an exception */
- xbt_
assert0(0,
"Oh oh, I can add an already existing dependency!");
+ SD_task_dependency_add(NULL, NULL, task
B, taskA
); /* shouldn't work and must raise an exception */
+ xbt_
die(
"Oh oh, I can add an already existing dependency!");
}
CATCH (ex) {
}
CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW;
+ xbt_ex_free(ex);
}
}
- SD_task_dependency_remove(taskA, taskB);
-
TRY {
TRY {
- SD_task_dependency_remove(task
C, taskA
); /* shouldn't work and must raise an exception */
- xbt_
assert0(0,
"Dude, I can remove an unknown dependency!");
+ SD_task_dependency_remove(task
A, taskC
); /* shouldn't work and must raise an exception */
+ xbt_
die(
"Dude, I can remove an unknown dependency!");
}
CATCH (ex) {
}
CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW;
+ xbt_ex_free(ex);
}
TRY {
SD_task_dependency_remove(taskC, taskC); /* shouldn't work and must raise an exception */
}
TRY {
SD_task_dependency_remove(taskC, taskC); /* shouldn't work and must raise an exception */
- xbt_
assert0(0,
"Wow, I can remove a dependency between Task C and itself!");
+ xbt_
die(
"Wow, I can remove a dependency between Task C and itself!");
}
CATCH (ex) {
}
CATCH (ex) {
+ if (ex.category != arg_error)
+ RETHROW;
+ xbt_ex_free(ex);
}
}
@@
-144,6
+156,13
@@
int main(int argc, char **argv) {
changed_tasks[2] == taskC &&
changed_tasks[3] == NULL,
"Unexpected simulation results");
changed_tasks[2] == taskC &&
changed_tasks[3] == NULL,
"Unexpected simulation results");
+
+ for (i = 0; changed_tasks[i] != NULL; i++) {
+ INFO3("Task '%s' start time: %f, finish time: %f",
+ SD_task_get_name(changed_tasks[i]),
+ SD_task_get_start_time(changed_tasks[i]),
+ SD_task_get_finish_time(changed_tasks[i]));
+ }
xbt_free(changed_tasks);
xbt_free(changed_tasks);