summaryrefslogtreecommitdiff
path: root/i/simulotron/src/gs/test_gs.cc
diff options
context:
space:
mode:
Diffstat (limited to 'i/simulotron/src/gs/test_gs.cc')
-rw-r--r--i/simulotron/src/gs/test_gs.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/i/simulotron/src/gs/test_gs.cc b/i/simulotron/src/gs/test_gs.cc
index a2d8724..5367a3d 100644
--- a/i/simulotron/src/gs/test_gs.cc
+++ b/i/simulotron/src/gs/test_gs.cc
@@ -79,8 +79,7 @@ int main(void)
// Reception des messages
// une string
GSMessage gsm;
- if (gst.getGS(gsm) != 0)
- throw std::runtime_error ("CHIER!! Reception mal passé");
+ while (gst.getGS(gsm) != 0);
if (strDepart != gsm.getGS())
{
std::cout << "CHIER String altéré\n"
@@ -91,8 +90,7 @@ int main(void)
}
gsm.clear();
// Un char
- if (gst.getGS(gsm) != 0)
- throw std::runtime_error ("CHIER!! Reception mal passé");
+ while (gst.getGS(gsm) != 0);
gsm.readGS(&b, sizeof(char));
if ( a != b)
{
@@ -104,8 +102,7 @@ int main(void)
}
gsm.clear();
// Un short
- if (gst.getGS(gsm) != 0)
- throw std::runtime_error ("CHIER!! Reception mal passé");
+ while (gst.getGS(gsm) != 0);
gsm.readGS(&s2, sizeof(short));
if ( s1 != s2)
{
@@ -117,8 +114,7 @@ int main(void)
}
gsm.clear();
// Un int positif
- if (gst.getGS(gsm) != 0)
- throw std::runtime_error ("CHIER!! Reception mal passé");
+ while (gst.getGS(gsm) != 0);
gsm.readGS(&i2, sizeof(int));
if ( i1 != i2)
{
@@ -130,8 +126,7 @@ int main(void)
}
gsm.clear();
// Un int negatif
- if (gst.getGS(gsm) != 0)
- throw std::runtime_error ("CHIER!! Reception mal passé");
+ while (gst.getGS(gsm) != 0);
gsm.readGS(&i4, sizeof(int));
if ( i3 != i4)
{
@@ -143,8 +138,7 @@ int main(void)
}
gsm.clear();
// Un Long
- if (gst.getGS(gsm) != 0)
- throw std::runtime_error ("CHIER!! Reception mal passé");
+ while (gst.getGS(gsm) != 0);
gsm.readGS(&l2, sizeof(long));
if ( l1 != l2)
{
@@ -156,8 +150,7 @@ int main(void)
}
gsm.clear();
// Un gros message
- if (gst.getGS(gsm) != 0)
- throw std::runtime_error ("CHIER!! Reception mal passé");
+ while (gst.getGS(gsm) != 0);
gsm.readGS(&s2,sizeof(short));
gsm.readGS(&l2,sizeof(long));
gsm.readGS(&i4,sizeof(int));