From 674f9fb111919f9dffaddf8c0732267f6dbfdf2a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 2 Mar 2012 14:56:00 -0500 Subject: Add LLLeap unit test for invalid length prefix from child stdout. --- indra/llcommon/tests/llleap_test.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index 053a6cea80..328b9c3562 100644 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -235,6 +235,20 @@ namespace tut template<> template<> void object::test<5>() + { + set_test_name("bad stdout len prefix"); + NamedTempFile script("py", + "import sys\n" + "sys.stdout.write('5a2:something')\n"); + CaptureLog log(LLError::LEVEL_WARN); + waitfor(LLLeap::create(get_test_name(), + sv(list_of(PYTHON)(script.getName())))); + ensure_contains("error log line", + log.messageWith("invalid protocol"), "5a2:"); + } + + template<> template<> + void object::test<6>() { set_test_name("empty plugin vector"); std::string threw; @@ -249,7 +263,7 @@ namespace tut } template<> template<> - void object::test<6>() + void object::test<7>() { set_test_name("bad launch"); // Synthesize bogus executable name @@ -329,7 +343,7 @@ namespace tut }; template<> template<> - void object::test<7>() + void object::test<8>() { set_test_name("round trip"); AckAPI api; @@ -361,7 +375,7 @@ namespace tut }; template<> template<> - void object::test<8>() + void object::test<9>() { set_test_name("many small messages"); // It's not clear to me whether there's value in iterating many times @@ -409,7 +423,7 @@ namespace tut } template<> template<> - void object::test<9>() + void object::test<10>() { set_test_name("very large message"); ReqIDAPI api; -- cgit v1.2.3