projects
/
wenboi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9de6a3a
)
closing stdin closes test_core now
author
Jorge Gorbe Moya
<jgorbe@dsic.upv.es>
Tue, 24 Jun 2008 10:36:01 +0000
(12:36 +0200)
committer
Jorge Gorbe Moya
<jgorbe@dsic.upv.es>
Tue, 24 Jun 2008 10:36:01 +0000
(12:36 +0200)
tests/test_core.cc
patch
|
blob
|
history
diff --git
a/tests/test_core.cc
b/tests/test_core.cc
index 2d31c895ac4bb47348e0544f697928863c5c3ffa..9825de903deb9cf38900ba63689faced3ba773ec 100644
(file)
--- a/
tests/test_core.cc
+++ b/
tests/test_core.cc
@@
-23,14
+23,14
@@
int main(int argc, char **argv)
cout << gb.status_string() << endl;
- bool exit_program=false;
string line, command, last_command;
vector<string> arguments;
- while(
!exit_program
)
+ while(
true
)
{
cout << "(wenboi) ";
std::getline(cin, line, '\n');
+ if (!cin.good()) break; // if stdin is closed, exit main loop
if (line == "") command = last_command;
else
{
@@
-55,7
+55,7
@@
int main(int argc, char **argv)
}
else if (command == "quit")
{
-
exit_program = true
;
+
break
;
}
else if (command == "disasm")
{