diff -r 74350decbb79 code/CMakeLists.txt
--- a/code/CMakeLists.txt	Sun Dec 05 20:33:58 2010 +0200
+++ b/code/CMakeLists.txt	Wed Dec 22 22:14:17 2010 +0200
@@ -197,6 +197,11 @@
   ENDIF(BUILD_DASHBOARD)
 ENDIF(WITH_NEL_TESTS)

+IF(WITH_SERVER_SHARE_TESTS)
+  ENABLE_TESTING()
+  ADD_TEST(server_share_unit_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/server_share_unit_test)
+ENDIF(WITH_SERVER_SHARE_TESTS)
+
 # packaging information
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeL MMORPG Framework")
 SET(CPACK_PACKAGE_VENDOR "NeL")
diff -r 74350decbb79 code/ryzom/tools/CMakeLists.txt
--- a/code/ryzom/tools/CMakeLists.txt	Sun Dec 05 20:33:58 2010 +0200
+++ b/code/ryzom/tools/CMakeLists.txt	Wed Dec 22 22:14:17 2010 +0200
@@ -9,5 +9,6 @@
 ADD_SUBDIRECTORY(patch_gen)
 ADD_SUBDIRECTORY(pdr_util)
 ADD_SUBDIRECTORY(stats_scan)
+ADD_SUBDIRECTORY(tests)

 IF(WITH_RYZOM_CLIENT)
diff -r 74350decbb79 code/ryzom/tools/tests/CMakeLists.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/CMakeLists.txt	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,1 @@
+ADD_SUBDIRECTORY(server_share_test)
\ No newline at end of file
diff -r 74350decbb79 code/ryzom/tools/tests/server_share_test/CMakeLists.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/server_share_test/CMakeLists.txt	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,12 @@
+FILE(GLOB SRC *.cpp *.h)
+
+ADD_EXECUTABLE(server_share_unit_test ${SRC})
+
+INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CPPTEST_INCLUDE_DIR} ${RZ_SERVER_SRC_DIR})
+TARGET_LINK_LIBRARIES(server_share_unit_test ryzom_servershare nelmisc nelnet nelligo nelgeorges ${LIBXML2_LIBRARIES} ${CPPTEST_LIBRARIES} ${ZLIB_LIBRARIES})
+ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
+
+NL_DEFAULT_PROPS(server_share_unit_test "Ryzom, Tools, Misc: server_share_unit_test")
+NL_ADD_RUNTIME_FLAGS(server_share_unit_test)
+
+INSTALL(TARGETS server_share_unit_test RUNTIME DESTINATION bin COMPONENT tools)
diff -r 74350decbb79 code/ryzom/tools/tests/server_share_test/server_share_unit_test.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/server_share_test/server_share_unit_test.cpp	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,88 @@
+
+#include <fstream>
+#include <cpptest.h>
+
+#include "ut_target.h"
+#include "ut_taming_tool_type.h"
+#include "ut_creature_size.h"
+#include "ut_place_type.h"
+#include "ut_item_service_type.h"
+
+#include <nel/misc/debug.h>
+
+using namespace std;
+static void usage()
+{
+	cout << "usage: mytest [MODE]\n"
+		 << "where MODE may be one of:\n"
+		 << "  --compiler\n"
+		 << "  --html\n"
+		 << "  --text-terse (default)\n"
+		 << "  --text-verbose\n";
+	exit(0);
+}
+
+static auto_ptr<Test::Output> cmdline(int argc, char* argv[])
+{
+	if (argc > 2)
+		usage(); // will not return
+
+	Test::Output* output = 0;
+
+	if (argc == 1)
+		output = new Test::TextOutput(Test::TextOutput::Verbose);
+	else
+	{
+		const char* arg = argv[1];
+		if (strcmp(arg, "--compiler") == 0)
+		{
+#ifdef _MSC_VER
+			output = new Test::CompilerOutput(Test::CompilerOutput::MSVC, msvDebug);
+#elif defined(__GNUC__)
+			output = new Test::CompilerOutput(Test::CompilerOutput::GCC);
+#else
+			output = new Test::CompilerOutput;
+#endif
+		}
+		else if (strcmp(arg, "--html") == 0)
+			output =  new Test::HtmlOutput;
+		else if (strcmp(arg, "--text-terse") == 0)
+			output = new Test::TextOutput(Test::TextOutput::Terse);
+		else if (strcmp(arg, "--text-verbose") == 0)
+			output = new Test::TextOutput(Test::TextOutput::Verbose);
+		else
+		{
+			cout << "invalid commandline argument: " << arg << endl;
+			usage(); // will not return
+		}
+	}
+
+	return auto_ptr<Test::Output>(output);
+}
+
+// Main test program
+//
+int main(int argc, char *argv[])
+{
+
+	static const char *outputFileName = "result.html";
+
+	Test::Suite ts;
+	ts.add(auto_ptr<Test::Suite>(new CUTTarget));
+	ts.add(auto_ptr<Test::Suite>(new CUTToolType));
+	ts.add(auto_ptr<Test::Suite>(new CUTCreatureSize));
+	ts.add(auto_ptr<Test::Suite>(new CUTPlaceType));
+	ts.add(auto_ptr<Test::Suite>(new CUTItemServiceType));
+	// Add a line here when adding a new test MODULE
+
+	auto_ptr<Test::Output> output(cmdline(argc, argv));
+	ts.run(*output);
+
+	Test::HtmlOutput* const html = dynamic_cast<Test::HtmlOutput*>(output.get());
+	if (html)
+	  {
+	    std::ofstream fout(outputFileName);
+	    html->generate(fout, true, "ServerShareTest");
+	  }
+	return 0;
+}
diff -r 74350decbb79 code/ryzom/tools/tests/server_share_test/ut_creature_size.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/server_share_test/ut_creature_size.h	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,30 @@
+#ifndef UT_CREATURE_SIZE
+#define UT_CREATURE_SIZE
+
+#include <server_share/creature_size.h>
+
+class CUTCreatureSize: public Test::Suite
+{
+ public:
+  CUTCreatureSize()
+    {
+      TEST_ADD(CUTCreatureSize::testToString);
+      TEST_ADD(CUTCreatureSize::testToCreatureSize);
+    }
+
+  void testToString()
+  {
+    TEST_ASSERT(CREATURE_SIZE::creatureSizeToString(CREATURE_SIZE::SMALL)=="SMALL");
+    TEST_ASSERT(CREATURE_SIZE::creatureSizeToString(CREATURE_SIZE::HOMIN)=="HOMIN");
+    TEST_ASSERT(CREATURE_SIZE::creatureSizeToString(CREATURE_SIZE::BIG)=="BIG");
+  }
+
+  void testToCreatureSize()
+  {
+    TEST_ASSERT(CREATURE_SIZE::stringToCreatureSize("SMALL")==CREATURE_SIZE::SMALL);
+    TEST_ASSERT(CREATURE_SIZE::stringToCreatureSize("HOMIN")==CREATURE_SIZE::HOMIN);
+    TEST_ASSERT(CREATURE_SIZE::stringToCreatureSize("BIG")==CREATURE_SIZE::BIG);
+  }
+};
+
+#endif
diff -r 74350decbb79 code/ryzom/tools/tests/server_share_test/ut_item_service_type.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/server_share_test/ut_item_service_type.h	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,38 @@
+#ifndef UT_ITEM_SERVICE_TYPE
+#define UT_ITEM_SERVICE_TYPE
+
+#include <server_share/item_service_type.h>
+
+class CUTItemServiceType: public Test::Suite
+{
+ public:
+  CUTItemServiceType()
+    {
+      TEST_ADD(CUTItemServiceType::toString);
+      TEST_ADD(CUTItemServiceType::fromString);
+    }
+
+  void toString()
+  {
+    TEST_ASSERT(ITEM_SERVICE_TYPE::toString(ITEM_SERVICE_TYPE::StableFeedAnimal1)=="StableFeedAnimal1");
+    TEST_ASSERT(ITEM_SERVICE_TYPE::toString(ITEM_SERVICE_TYPE::StableFeedAnimal2)=="StableFeedAnimal2");
+    TEST_ASSERT(ITEM_SERVICE_TYPE::toString(ITEM_SERVICE_TYPE::StableFeedAnimal3)=="StableFeedAnimal3");
+    TEST_ASSERT(ITEM_SERVICE_TYPE::toString(ITEM_SERVICE_TYPE::StableFeedAnimal4)=="StableFeedAnimal4");
+    TEST_ASSERT(ITEM_SERVICE_TYPE::toString(ITEM_SERVICE_TYPE::StableFeedAllAnimals)=="StableFeedAllAnimals");
+    TEST_ASSERT(ITEM_SERVICE_TYPE::toString(ITEM_SERVICE_TYPE::SpeedUpDPLoss)=="SpeedUpDPLoss");
+    TEST_ASSERT(ITEM_SERVICE_TYPE::toString(ITEM_SERVICE_TYPE::Unknown)=="Unknown");
+  }
+
+  void fromString()
+  {
+    TEST_ASSERT(ITEM_SERVICE_TYPE::fromString("StableFeedAnimal1")==ITEM_SERVICE_TYPE::StableFeedAnimal1);
+    TEST_ASSERT(ITEM_SERVICE_TYPE::fromString("StableFeedAnimal2")==ITEM_SERVICE_TYPE::StableFeedAnimal2);
+    TEST_ASSERT(ITEM_SERVICE_TYPE::fromString("StableFeedAnimal3")==ITEM_SERVICE_TYPE::StableFeedAnimal3);
+    TEST_ASSERT(ITEM_SERVICE_TYPE::fromString("StableFeedAnimal4")==ITEM_SERVICE_TYPE::StableFeedAnimal4);
+    TEST_ASSERT(ITEM_SERVICE_TYPE::fromString("StableFeedAllAnimals")==ITEM_SERVICE_TYPE::StableFeedAllAnimals);
+    TEST_ASSERT(ITEM_SERVICE_TYPE::fromString("SpeedUpDPLoss")==ITEM_SERVICE_TYPE::SpeedUpDPLoss);
+    TEST_ASSERT(ITEM_SERVICE_TYPE::fromString("Unknown")==ITEM_SERVICE_TYPE::Unknown);
+  }
+};
+
+#endif
diff -r 74350decbb79 code/ryzom/tools/tests/server_share_test/ut_place_type.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/server_share_test/ut_place_type.h	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,36 @@
+#ifndef UT_PLACETYPE
+#define UT_PLACETYPE
+
+#include <server_share/place_type.h>
+
+class CUTPlaceType: public Test::Suite
+{
+ public:
+  CUTPlaceType()
+    {
+      TEST_ADD(CUTPlaceType::testToString);
+      TEST_ADD(CUTPlaceType::testFromString);
+    }
+
+  void testToString()
+  {
+    TEST_ASSERT(PLACE_TYPE::toString(PLACE_TYPE::Capital)=="Capital");
+    TEST_ASSERT(PLACE_TYPE::toString(PLACE_TYPE::Village)=="Village");
+    TEST_ASSERT(PLACE_TYPE::toString(PLACE_TYPE::Outpost)=="Outpost");
+    TEST_ASSERT(PLACE_TYPE::toString(PLACE_TYPE::Place)=="Place");
+    TEST_ASSERT(PLACE_TYPE::toString(PLACE_TYPE::Street)=="Street");
+    TEST_ASSERT(PLACE_TYPE::toString(PLACE_TYPE::Undefined)=="Undefined");
+  }
+
+  void testFromString()
+  {
+    TEST_ASSERT(PLACE_TYPE::fromString("Capital")==PLACE_TYPE::Capital);
+    TEST_ASSERT(PLACE_TYPE::fromString("Village")==PLACE_TYPE::Village);
+    TEST_ASSERT(PLACE_TYPE::fromString("Outpost")==PLACE_TYPE::Outpost);
+    TEST_ASSERT(PLACE_TYPE::fromString("Place")==PLACE_TYPE::Place);
+    TEST_ASSERT(PLACE_TYPE::fromString("Street")==PLACE_TYPE::Street);
+    TEST_ASSERT(PLACE_TYPE::fromString("Undefined")==PLACE_TYPE::Undefined);
+  }
+};
+
+#endif
diff -r 74350decbb79 code/ryzom/tools/tests/server_share_test/ut_taming_tool_type.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/server_share_test/ut_taming_tool_type.h	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,32 @@
+#ifndef UT_TAMING_TOOL_TYPE
+#define UT_TAMING_TOOL_TYPE
+
+#include <server_share/taming_tool_type.h>
+
+class CUTToolType: public Test::Suite
+{
+ public:
+  CUTToolType()
+    {
+      TEST_ADD(CUTToolType::testToString);
+      TEST_ADD(CUTToolType::testToToolType);
+    }
+
+  void testToString()
+  {
+    TEST_ASSERT(TAMING_TOOL_TYPE::toString(TAMING_TOOL_TYPE::Unknown)=="Unknown");
+    TEST_ASSERT(TAMING_TOOL_TYPE::toString(TAMING_TOOL_TYPE::Cattleprod)=="Cattleprod");
+    TEST_ASSERT(TAMING_TOOL_TYPE::toString(TAMING_TOOL_TYPE::Stick)=="Stick");
+    TEST_ASSERT(TAMING_TOOL_TYPE::toString(TAMING_TOOL_TYPE::Whip)=="Whip");
+  }
+
+  void testToToolType()
+  {
+    TEST_ASSERT(TAMING_TOOL_TYPE::toToolType("Unknown")==TAMING_TOOL_TYPE::Unknown);
+    TEST_ASSERT(TAMING_TOOL_TYPE::toToolType("Cattleprod")==TAMING_TOOL_TYPE::Cattleprod);
+    TEST_ASSERT(TAMING_TOOL_TYPE::toToolType("Stick")==TAMING_TOOL_TYPE::Stick);
+    TEST_ASSERT(TAMING_TOOL_TYPE::toToolType("Whip")==TAMING_TOOL_TYPE::Whip);
+  }
+};
+
+#endif
diff -r 74350decbb79 code/ryzom/tools/tests/server_share_test/ut_target.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code/ryzom/tools/tests/server_share_test/ut_target.h	Wed Dec 22 22:14:17 2010 +0200
@@ -0,0 +1,28 @@
+#ifndef UT_TARGET
+#define UT_TARGET
+
+#include <server_share/target.h>
+
+class CUTTarget: public Test::Suite
+{
+ public:
+  CUTTarget()
+    {
+      TEST_ADD(CUTTarget::testToString);
+      TEST_ADD(CUTTarget::testToTargetRestriction);
+    }
+
+  void testToString()
+  {
+    TEST_ASSERT(TARGET::targetRestrictionToString(TARGET::SelfOnly)=="SelfOnly");
+    TEST_ASSERT(TARGET::targetRestrictionToString(TARGET::TargetRestrictionCount)=="TargetRestrictionCount");
+  }
+
+  void testToTargetRestriction()
+  {
+    TEST_ASSERT(TARGET::stringToTargetRestriction("SelfOnly")==TARGET::SelfOnly);
+    TEST_ASSERT(TARGET::stringToTargetRestriction("TargetRestrictionCount")==TARGET::TargetRestrictionCount);
+  }
+};
+
+#endif
