diff options
author | Tess Chu <tess@lindenlab.com> | 2007-07-11 21:29:02 +0000 |
---|---|---|
committer | Tess Chu <tess@lindenlab.com> | 2007-07-11 21:29:02 +0000 |
commit | 57b8fef824b6d7f37c5be5812ebffa39ab2e8093 (patch) | |
tree | f89014544fc276b283a36eb2e0cb52e93806a44a /indra/test/message_tut.cpp | |
parent | a6769f262ff910949a7e1c81cf98e52ddfc2d44a (diff) |
svn merge --ignore-ancestry svn+ssh://svn/svn/linden/release@65088 svn+ssh://svn/svn/linden/branches/release-candidate@65078 -> release Paired by Tess and rdw.
Diffstat (limited to 'indra/test/message_tut.cpp')
-rw-r--r-- | indra/test/message_tut.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp new file mode 100644 index 0000000000..a08c3130f1 --- /dev/null +++ b/indra/test/message_tut.cpp @@ -0,0 +1,77 @@ +/** + * @file lldatapacker_tut.cpp + * @date 2007-04 + * @brief LLDataPacker test cases. + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include <tut/tut.h> +#include "lltut.h" + +#include "llapr.h" +#include "llversion.h" +#include "message.h" +#include "message_prehash.h" + +namespace +{ + struct Response : public LLHTTPNode::Response + { + virtual void result(const LLSD&) {} + virtual void status(S32 code, const std::string& message) + { + mStatus = code; + } + S32 mStatus; + }; +} + +namespace tut +{ + struct LLMessageSystemTestData + { + LLMessageSystemTestData() + { + static bool init = false; + if(! init) + { + ll_init_apr(); + init_prehash_data(); + init = true; + } + + // currently test disconnected message system + start_messaging_system("notafile", 13035, + LL_VERSION_MAJOR, + LL_VERSION_MINOR, + LL_VERSION_PATCH, + FALSE, + "notasharedsecret"); + } + + ~LLMessageSystemTestData() + { + // not end_messaging_system() + delete gMessageSystem; + gMessageSystem = NULL; + } + }; + + typedef test_group<LLMessageSystemTestData> LLMessageSystemTestGroup; + typedef LLMessageSystemTestGroup::object LLMessageSystemTestObject; + LLMessageSystemTestGroup messageTestGroup("LLMessageSystem"); + + template<> template<> + void LLMessageSystemTestObject::test<1>() + // dispatch unknown message + { + const char* name = "notamessasge"; + const LLSD message; + const LLPointer<Response> response = new Response(); + gMessageSystem->dispatch(name, message, response); + ensure_equals(response->mStatus, 404); + } +} + |