--- /dev/null
+#include <cppunit/extensions/HelperMacros.h>
+
+
+extern "C" {
+#include "edg/workload/logging/common/il_string.h"
+}
+
+class IlIntTest: public CppUnit::TestFixture
+{
+ CPPUNIT_TEST_SUITE( IlIntTest );
+ CPPUNIT_TEST( testPutInt );
+ CPPUNIT_TEST( testGetInt );
+ CPPUNIT_TEST( testLenInt );
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() {
+ }
+
+ void tearDown() {
+ }
+
+ void testPutInt() {
+ put_int(buffer, 17);
+ CPPUNIT_ASSERT(!strcmp(buffer, "17\n"));
+ }
+
+ void testGetInt() {
+ int d;
+ get_int("17\n", &d);
+ CPPUNIT_ASSERT(d == 17);
+ }
+
+ void testLenInt() {
+ CPPUNIT_ASSERT(3 == len_int(17));
+ }
+
+protected:
+ char buffer[255];
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( IlIntTest ) ;
+
--- /dev/null
+#include <cppunit/extensions/HelperMacros.h>
+
+
+extern "C" {
+#include "edg/workload/logging/common/il_string.h"
+}
+
+class IlStringTest : public CppUnit::TestFixture
+{
+ CPPUNIT_TEST_SUITE( IlStringTest );
+ CPPUNIT_TEST( testPutString );
+ CPPUNIT_TEST( testGetString );
+ CPPUNIT_TEST( testLenString );
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void setUp() {
+ }
+
+ void tearDown() {
+ }
+
+ void testPutString() {
+ put_string(buffer, "ahoj");
+ CPPUNIT_ASSERT( !strcmp(buffer, "4 ahoj\n") );
+ }
+
+ void testGetString() {
+ char *s;
+ get_string("4 ahoj\n", &s);
+ CPPUNIT_ASSERT( s != NULL );
+ CPPUNIT_ASSERT( !strcmp(s, "ahoj") );
+ free(s);
+ }
+
+ void testLenString() {
+ int d = len_string("ahoj");
+ CPPUNIT_ASSERT( d == 7);
+ }
+
+private:
+ char buffer[255];
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( IlStringTest );
--- /dev/null
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TextTestRunner.h>
+
+
+int main(int argc, char *argv[])
+{
+ CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
+ CppUnit::TextTestRunner runner;
+
+ runner.addTest(suite);
+ runner.setOutputter(CppUnit::CompilerOutputter::defaultOutputter(&runner.result(), std::cerr));
+
+ return runner.run() ? 0 : 1;
+}