Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
60d5661c
Commit
60d5661c
authored
Dec 20, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(HourGlass): небольшой рефакторинг rename state() --> enabled().
Чтобы не путать state() и check()..
parent
ce7dc95f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
HourGlass.h
include/HourGlass.h
+1
-1
test_hourglass.cc
tests/test_hourglass.cc
+3
-3
No files found.
include/HourGlass.h
View file @
60d5661c
...
...
@@ -143,7 +143,7 @@ class HourGlass
return
t
.
checkTime
();
}
inline
bool
state
(){
return
_state
;
}
inline
bool
enabled
(){
return
_state
;
}
// текущее "насыпавшееся" количество "песка"
inline
timeout_t
amount
()
...
...
tests/test_hourglass.cc
View file @
60d5661c
...
...
@@ -18,7 +18,7 @@ TEST_CASE("HourGlass", "[HourGlass]" )
REQUIRE
(
hg
.
interval
()
==
0
);
REQUIRE
(
hg
.
amount
()
==
0
);
REQUIRE
(
hg
.
remain
()
==
0
);
CHECK_FALSE
(
hg
.
state
()
);
CHECK_FALSE
(
hg
.
enabled
()
);
CHECK_FALSE
(
hg
.
check
()
);
}
...
...
@@ -26,7 +26,7 @@ TEST_CASE("HourGlass", "[HourGlass]" )
{
HourGlass
hg
;
hg
.
run
(
100
);
CHECK
(
hg
.
state
()
);
// часы начали тикать.. (в нормальном положении)
CHECK
(
hg
.
enabled
()
);
// часы начали тикать.. (в нормальном положении)
REQUIRE
(
hg
.
duration
()
==
100
);
CHECK_FALSE
(
hg
.
check
()
);
msleep
(
110
);
...
...
@@ -36,7 +36,7 @@ TEST_CASE("HourGlass", "[HourGlass]" )
// "песок высыпается назад" в течении 50 мсек,
// потом опять ставим "на ноги", ждём 60 мсек.. должно сработать
hg
.
rotate
(
false
);
CHECK_FALSE
(
hg
.
state
()
);
CHECK_FALSE
(
hg
.
enabled
()
);
CHECK_FALSE
(
hg
.
check
()
);
msleep
(
50
);
CHECK_FALSE
(
hg
.
check
()
);
...
...
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