summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/motor/test_asserv.cc
diff options
context:
space:
mode:
Diffstat (limited to '2004/i/nono/src/motor/test_asserv.cc')
-rw-r--r--2004/i/nono/src/motor/test_asserv.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/2004/i/nono/src/motor/test_asserv.cc b/2004/i/nono/src/motor/test_asserv.cc
index cd8b55e..c83e72d 100644
--- a/2004/i/nono/src/motor/test_asserv.cc
+++ b/2004/i/nono/src/motor/test_asserv.cc
@@ -23,12 +23,12 @@
//
// }}}
#include "asserv.h"
-#include "erreur/erreur.h"
#include "date/date.h"
#include <iostream>
#include <unistd.h>
-#include <stdlib.h>
+#include <cstdlib>
+#include <stdexcept>
using namespace std;
@@ -77,22 +77,22 @@ main (int argc, char **argv)
{
case 's':
at.reset ();
- cout << "stop" << endl;
+ std::cout << "stop" << std::endl;
i++;
m.stop ();
break;
case 'z':
- cout << "rezet" << endl;
+ std::cout << "rezet" << std::endl;
i++;
m.reset ();
break;
case 'g':
- cout << "go" << endl;
+ std::cout << "go" << std::endl;
i++;
m.setAsserv ();
break;
case 'G':
- cout << "ungo" << endl;
+ std::cout << "ungo" << std::endl;
i++;
m.setAsserv (false);
break;
@@ -103,7 +103,7 @@ main (int argc, char **argv)
vg = atoi (argv[i++]);
if (i >= argc) break;
vd = atoi (argv[i++]);
- cout << "speed " << vg << ' ' << vd << endl;
+ std::cout << "speed " << vg << ' ' << vd << std::endl;
m.speed (vg, vd);
break;
case '?':
@@ -117,8 +117,10 @@ main (int argc, char **argv)
syntax ();
return 1;
}
- cout << "sleep " << s << endl;
- for (int j = 0; j < s * 1000 / 50; ++j)
+ std::cout << "sleep " << s << std::endl;
+ int start;
+ start = Date::getInstance ().start ();
+ while (Date::getInstance ().start () < start + s)
{
m.ok ();
Date::wait (1);
@@ -130,9 +132,9 @@ main (int argc, char **argv)
at.aff ();
return 0;
}
- catch (Erreur &e)
+ catch (const std::exception &e)
{
- cerr << e.what () << endl;
+ std::cerr << e.what () << std::endl;
return 1;
}
}