Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
6d601583
Commit
6d601583
authored
Jan 05, 2013
by
Davis King
Browse files
Made test more robust and also added more print_spinner()
calls.
parent
a4f04870
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
dlib/test/timer.cpp
dlib/test/timer.cpp
+15
-0
No files found.
dlib/test/timer.cpp
View file @
6d601583
...
...
@@ -39,6 +39,7 @@ namespace
void
delayed_add
()
{
dlib
::
sleep
(
1000
);
print_spinner
();
add
();
}
...
...
@@ -48,6 +49,7 @@ namespace
timestamp
=
ts
.
get_timestamp
();
dlog
<<
LTRACE
<<
"in set_timestamp(), time is "
<<
timestamp
;
dlib
::
sleep
(
1
);
print_spinner
();
m
.
unlock
();
}
};
...
...
@@ -76,6 +78,7 @@ namespace
t1
.
start
();
dlib
::
sleep
(
60
);
print_spinner
();
t1
.
stop_and_wait
();
dlib
::
uint64
cur_time
=
h
.
ts
.
get_timestamp
();
...
...
@@ -213,6 +216,7 @@ namespace
DLIB_TEST
(
t3
.
is_running
()
==
true
);
dlib
::
sleep
(
1100
);
print_spinner
();
// this should allow the timers to trigger 8 times
t1
.
stop
();
t2
.
stop
();
...
...
@@ -224,20 +228,27 @@ namespace
}
t1
.
stop_and_wait
();
h
.
count
=
0
;
t1
.
start
();
dlib
::
sleep
(
300
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
t1
.
set_delay_time
(
400
);
dlib
::
sleep
(
200
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
1
,
h
.
count
);
dlib
::
sleep
(
250
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
1
,
h
.
count
);
dlib
::
sleep
(
100
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
2
,
h
.
count
);
t1
.
set_delay_time
(
2000
);
DLIB_TEST_MSG
(
h
.
count
==
2
,
h
.
count
);
dlib
::
sleep
(
1000
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
2
,
h
.
count
);
t1
.
clear
();
...
...
@@ -251,6 +262,7 @@ namespace
DLIB_TEST
(
t3
.
delay_time
()
==
1000
);
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
dlib
::
sleep
(
200
);
print_spinner
();
DLIB_TEST
(
t3
.
is_running
()
==
false
);
DLIB_TEST
(
t3
.
delay_time
()
==
1000
);
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
...
...
@@ -263,6 +275,7 @@ namespace
t4
.
start
();
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
dlib
::
sleep
(
400
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
t4
.
stop_and_wait
();
DLIB_TEST_MSG
(
h
.
count
==
1
,
h
.
count
);
...
...
@@ -276,6 +289,7 @@ namespace
t4
.
start
();
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
dlib
::
sleep
(
400
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
t4
.
clear
();
DLIB_TEST
(
t4
.
is_running
()
==
false
);
...
...
@@ -292,6 +306,7 @@ namespace
t5
.
start
();
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
dlib
::
sleep
(
400
);
print_spinner
();
DLIB_TEST_MSG
(
h
.
count
==
0
,
h
.
count
);
}
DLIB_TEST_MSG
(
h
.
count
==
1
,
h
.
count
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment