From 0c2442eb684a060d5582c154c95cb995a64ae70c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 29 Aug 2016 18:48:47 +0000 Subject: MAINT-5011: Fix abbreviateFile() test to run under .../indra/ path. This particular test relied on there being exactly one instance of the string "indra" in the source file's __FILE__ path -- which is usually true, but not if the developer clones the viewer source repo under a parent directory whose path itself contains "indra". Fix to handle any number of occurrences. --- indra/llcommon/tests/llerror_test.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/tests/llerror_test.cpp') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index f51279e817..8bace8ac41 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -237,8 +237,21 @@ namespace tut void ErrorTestObject::test<4>() // file abbreviation { - std::string thisFile = __FILE__; - std::string abbreviateFile = LLError::abbreviateFile(thisFile); + std::string prev, abbreviateFile = __FILE__; + do + { + prev = abbreviateFile; + abbreviateFile = LLError::abbreviateFile(abbreviateFile); + // __FILE__ is assumed to end with + // indra/llcommon/tests/llerror_test.cpp. This test used to call + // abbreviateFile() exactly once, then check below whether it + // still contained the string 'indra'. That fails if the FIRST + // part of the pathname also contains indra! Certain developer + // machine images put local directory trees under + // /ngi-persist/indra, which is where we observe the problem. So + // now, keep calling abbreviateFile() until it returns its + // argument unchanged, THEN check. + } while (abbreviateFile != prev); ensure_ends_with("file name abbreviation", abbreviateFile, -- cgit v1.2.3 From 972b0b2f1bfcad32f2a12b613d4a249658895715 Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Mon, 10 Oct 2016 12:31:01 -0700 Subject: maint-6633: fix unit test to conform with new desired ordering --- indra/llcommon/tests/llerror_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/tests/llerror_test.cpp') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index f51279e817..404f3e51ae 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -551,9 +551,9 @@ namespace tut function; writeReturningLocationAndFunction(location, function); - ensure_equals("order is location time type function message", + ensure_equals("order is time location type function message", message(0), - location + roswell() + " INFO: " + function + ": apple"); + roswell() + lcoation + " INFO: " + function + ": apple"); } template<> template<> -- cgit v1.2.3 From c39b7f2d88f1e345a0a202b9a624d973bc8c97de Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Mon, 10 Oct 2016 13:37:42 -0700 Subject: maint-6633: fix tyop --- indra/llcommon/tests/llerror_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/tests/llerror_test.cpp') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 404f3e51ae..b5bd6a7c9e 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -553,7 +553,7 @@ namespace tut ensure_equals("order is time location type function message", message(0), - roswell() + lcoation + " INFO: " + function + ": apple"); + roswell() + location + " INFO: " + function + ": apple"); } template<> template<> -- cgit v1.2.3 From acfbcc73527c85399ebfa750f2cd377debd12cd2 Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Mon, 10 Oct 2016 14:15:29 -0700 Subject: maint-6633: move INFO around --- indra/llcommon/tests/llerror_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/tests/llerror_test.cpp') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index b5bd6a7c9e..b20345d50e 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -553,7 +553,7 @@ namespace tut ensure_equals("order is time location type function message", message(0), - roswell() + location + " INFO: " + function + ": apple"); + roswell() + " INFO:" + location + function + ": apple"); } template<> template<> -- cgit v1.2.3 From cea2e4a7ad0f340c8bc582030490eee1099f19bf Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Mon, 10 Oct 2016 15:14:46 -0700 Subject: maint-6633: fix spacing --- indra/llcommon/tests/llerror_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/tests/llerror_test.cpp') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index b20345d50e..8e79da9834 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -553,7 +553,7 @@ namespace tut ensure_equals("order is time location type function message", message(0), - roswell() + " INFO:" + location + function + ": apple"); + roswell() + " INFO:" + location + " " + function + ": apple"); } template<> template<> -- cgit v1.2.3 From e6043fad2ab549a16f1bf4e81851357de4995862 Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Tue, 11 Oct 2016 09:21:33 -0700 Subject: maint-6633: space after colon --- indra/llcommon/tests/llerror_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/tests/llerror_test.cpp') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 8e79da9834..64624fc6c2 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -553,7 +553,7 @@ namespace tut ensure_equals("order is time location type function message", message(0), - roswell() + " INFO:" + location + " " + function + ": apple"); + roswell() + " INFO: " + location + " " + function + ": apple"); } template<> template<> -- cgit v1.2.3 From 19f576872aec60aae359e567cdd80f3d081b2b73 Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Tue, 11 Oct 2016 11:41:25 -0700 Subject: maint-6633: space, the final frontier --- indra/llcommon/tests/llerror_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/tests/llerror_test.cpp') diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 64624fc6c2..364d2d13dd 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -553,7 +553,7 @@ namespace tut ensure_equals("order is time location type function message", message(0), - roswell() + " INFO: " + location + " " + function + ": apple"); + roswell() + " INFO: " + location + function + ": apple"); } template<> template<> -- cgit v1.2.3