summaryrefslogtreecommitdiff
path: root/i/siroco/src/pg_test
diff options
context:
space:
mode:
authorgalmes2004-01-23 18:52:59 +0000
committergalmes2004-01-23 18:52:59 +0000
commita8609189954e4708b0aec010e336a9994aee3a44 (patch)
tree5c0af1480fe4c43bcef043df9e2241e37b878fd1 /i/siroco/src/pg_test
parentd9dc092f02140ad36885b2951487b55d4c745317 (diff)
Ajout des tests des classes message_asservissement_get_info et
message_asservissement_info
Diffstat (limited to 'i/siroco/src/pg_test')
-rwxr-xr-xi/siroco/src/pg_test/Makefile22
-rw-r--r--i/siroco/src/pg_test/message_asservissement_get_info_test.cc42
-rw-r--r--i/siroco/src/pg_test/message_asservissement_info_test.cc43
3 files changed, 102 insertions, 5 deletions
diff --git a/i/siroco/src/pg_test/Makefile b/i/siroco/src/pg_test/Makefile
index 4198f3b..e9575fd 100755
--- a/i/siroco/src/pg_test/Makefile
+++ b/i/siroco/src/pg_test/Makefile
@@ -2,8 +2,12 @@
TARGET_A = message_test
OBJECTS_A = message_test.o ../message.o
-# TARGET_B = message
-# OBJECTS_B =
+TARGET_B = message_asservissement_info_test
+OBJECTS_B = message_asservissement_info_test.o ../message_asservissement_info.o ../message.o
+
+TARGET_MAGI = message_asservissement_get_info_test
+OBJECTS_MAGI = message_asservissement_get_info_test.o \
+ ../message_asservissement_get_info.o ../message.o
# LIB = -lccgnu2 -ldl -pthread
@@ -11,17 +15,25 @@ CFLAGS = -O2 -Wall -g
CC = g++
-all: $(TARGET_A)
-#$(TARGET_B)
+all: $(TARGET_A)
+
$(TARGET_A): $(OBJECTS_A)
$(CC) $(CFLAGS) -o $@ $^
+mai: $(TARGET_B)
+
+$(TARGET_B): $(OBJECTS_B)
+ $(CC) $(CFLAGS) -o $@ $^
+
+magi: $(TARGET_MAGI)
+$(TARGET_MAGI): $(OBJECTS_MAGI)
+ $(CC) $(CFLAGS) -o $@ $^
#$(LIB)
# $(TARGET_B): $(OBJECTS_B)
# $(CC) $(CFLAGS) -o $@ $^ $(LIB)
clean:
- rm -f *.o tar rmt testpad testpad.h core
+ rm -f *.o message_test core
diff --git a/i/siroco/src/pg_test/message_asservissement_get_info_test.cc b/i/siroco/src/pg_test/message_asservissement_get_info_test.cc
new file mode 100644
index 0000000..8e1662a
--- /dev/null
+++ b/i/siroco/src/pg_test/message_asservissement_get_info_test.cc
@@ -0,0 +1,42 @@
+// message_asservissement_get_info_test.cc
+// {{{
+//
+// Copyright (C) 2004 Pierre-André Galmes
+//
+// Robot APB Team/Efrei 2004.
+// Web: http://assos.efrei.fr/robot/
+// Email: robot AT efrei DOT fr
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// }}}
+#include <iostream>
+#include "../message_asservissement_get_info.h"
+
+using namespace std;
+using namespace Siroco;
+
+int
+main (void)
+{
+ Message::Type type = Message::typeAsservissementData;
+ MessageAsservissementGetInfo m;
+
+ //MessageAsservissementInfo m (type);
+ // MessageAsservissementInfo m (p, i, d, cMin, pMin, mMin, cMax, pMax, mMax);
+
+
+ cout << "type du message" << m.getType () << endl;
+}
diff --git a/i/siroco/src/pg_test/message_asservissement_info_test.cc b/i/siroco/src/pg_test/message_asservissement_info_test.cc
new file mode 100644
index 0000000..e2badc7
--- /dev/null
+++ b/i/siroco/src/pg_test/message_asservissement_info_test.cc
@@ -0,0 +1,43 @@
+// message_asservissement_info_test.cc
+// {{{
+//
+// Copyright (C) 2004 Pierre-André Galmes
+//
+// Robot APB Team/Efrei 2004.
+// Web: http://assos.efrei.fr/robot/
+// Email: robot AT efrei DOT fr
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// }}}
+#include <iostream>
+#include "../message_asservissement_info.h"
+
+using namespace std;
+using namespace Siroco;
+
+int
+main (void)
+{
+ int p = 10, i = 10, d = 10, cMin, pMin, mMin, cMax, pMax, mMax;
+ Message::Type type = Message::typeAsservissementData;
+ MessageAsservissementInfo m (type);
+
+ //MessageAsservissementInfo m (type);
+ // MessageAsservissementInfo m (p, i, d, cMin, pMin, mMin, cMax, pMax, mMax);
+
+ m.getPID (p, i, d);
+ cout << "pid : " << p << " " << i << " " << d << endl;
+}