summaryrefslogtreecommitdiff
path: root/cesar/maximus/phy/src/PhySciMsgNoiseTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/maximus/phy/src/PhySciMsgNoiseTest.cpp')
-rw-r--r--cesar/maximus/phy/src/PhySciMsgNoiseTest.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/cesar/maximus/phy/src/PhySciMsgNoiseTest.cpp b/cesar/maximus/phy/src/PhySciMsgNoiseTest.cpp
new file mode 100644
index 0000000000..521e0feef9
--- /dev/null
+++ b/cesar/maximus/phy/src/PhySciMsgNoiseTest.cpp
@@ -0,0 +1,64 @@
+
+#include "PhySciMsgNoiseTest.h"
+
+#include "PhySciMsgNoise.h"
+#include "PhyProcessor.h"
+#include "SciServer.h"
+
+#include "Logger.h"
+
+// for 'getpid()'
+#include <sys/types.h>
+#include <unistd.h>
+
+using namespace std;
+
+
+CPPUNIT_TEST_SUITE_REGISTRATION (PhySciMsgNoiseTest);
+
+
+void PhySciMsgNoiseTest::setUp (void)
+{
+ logTest();
+
+ mpSci = new SciServer();
+ mpPhy = new PhyProcessor(mpSci);
+ mpPhySciMsgNoise = new PhySciMsgNoise(mpPhy);
+ CPPUNIT_ASSERT_MESSAGE ( "creation failed",
+ (mpPhy == mpPhySciMsgNoise->getPhyProcessor())
+ && (NULL != mpPhySciMsgNoise)
+ && (PHY_TYPE_NOISE == mpPhySciMsgNoise->getSpecializedSciMsgType()) );
+}
+
+
+void PhySciMsgNoiseTest::tearDown (void)
+{
+ logTest();
+
+ if (NULL != mpPhySciMsgNoise)
+ {
+ delete (mpPhySciMsgNoise);
+ mpPhySciMsgNoise = NULL;
+ }
+ if (NULL != mpPhy)
+ {
+ delete (mpPhy);
+ mpPhy = NULL;
+ }
+ if (NULL != mpSci)
+ {
+ delete (mpSci);
+ mpSci = NULL;
+ }
+}
+
+
+void PhySciMsgNoiseTest::prepareTest (void)
+{
+ logTest();
+
+ CPPUNIT_ASSERT_MESSAGE ( "prepare failed",
+ (mpPhySciMsgNoise->prepare())
+ && (PHY_FLAG_CRC_OK == mpPhySciMsgNoise->getFlags()) );
+}
+