From f7a689954d82d07cfd1e77353edbfb7ef96fafd6 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Wed, 2 May 2007 01:37:28 +0000 Subject: * tests/utf.test (utf-25.1--utf-25.4): Modified tests to clean up after the 'testobj' extension to avoid spurious reports of memory leaks. --- ChangeLog | 3 ++ tests/utf.test | 100 ++++++++++++++++++++++++++++++++++++++------------------- 2 files changed, 70 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15f200e..16a74bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ first. [Bug 1710285] * generic/tclThread.c (TclFinalizeSynchronization): Make sure that TSD blocks get freed on non-threaded builds. [Bug 1710825] + * tests/utf.test (utf-25.1--utf-25.4): Modified tests to + clean up after the 'testobj' extension to avoid spurious + reports of memory leaks. 2007-05-01 Don Porter diff --git a/tests/utf.test b/tests/utf.test index d5df773..575a5cd 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: utf.test,v 1.13 2005/09/07 15:31:10 dgp Exp $ +# RCS: @(#) $Id: utf.test,v 1.14 2007/05/02 01:37:28 kennykb Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -319,39 +319,73 @@ test utf-24.4 {unicode space char in regc_locale.c} { } {1 1} testConstraint teststringobj [llength [info commands teststringobj]] -test utf-25.1 {Tcl_UniCharNcasecmp} teststringobj { - testobj freeallvars - teststringobj set 1 a - teststringobj set 2 b - teststringobj getunicode 1 - teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] -} -1 -test utf-25.2 {Tcl_UniCharNcasecmp} teststringobj { - testobj freeallvars - teststringobj set 1 b - teststringobj set 2 a - teststringobj getunicode 1 - teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] -} 1 -test utf-25.3 {Tcl_UniCharNcasecmp} teststringobj { - testobj freeallvars - teststringobj set 1 B - teststringobj set 2 a - teststringobj getunicode 1 - teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] -} 1 -test utf-25.4 {Tcl_UniCharNcasecmp} teststringobj { - testobj freeallvars - teststringobj set 1 aBcB - teststringobj set 2 abca - teststringobj getunicode 1 - teststringobj getunicode 2 - string compare -nocase [teststringobj get 1] [teststringobj get 2] -} 1 + +test utf-25.1 {Tcl_UniCharNcasecmp} -constraints teststringobj \ + -setup { + testobj freeallvars + } \ + -body { + teststringobj set 1 a + teststringobj set 2 b + teststringobj getunicode 1 + teststringobj getunicode 2 + string compare -nocase [teststringobj get 1] [teststringobj get 2] + } \ + -cleanup { + testobj freeallvars + } \ + -result -1 +test utf-25.2 {Tcl_UniCharNcasecmp} -constraints teststringobj \ + -setup { + testobj freeallvars + } \ + -body { + teststringobj set 1 b + teststringobj set 2 a + teststringobj getunicode 1 + teststringobj getunicode 2 + string compare -nocase [teststringobj get 1] [teststringobj get 2] + } \ + -cleanup { + testobj freeallvars + } \ + -result 1 +test utf-25.3 {Tcl_UniCharNcasecmp} -constraints teststringobj \ + -setup { + testobj freeallvars + } \ + -body { + teststringobj set 1 B + teststringobj set 2 a + teststringobj getunicode 1 + teststringobj getunicode 2 + string compare -nocase [teststringobj get 1] [teststringobj get 2] + } \ + -cleanup { + testobj freeallvars + } \ + -result 1 + +test utf-25.4 {Tcl_UniCharNcasecmp} -constraints teststringobj \ + -setup { + testobj freeallvars + } \ + -body { + teststringobj set 1 aBcB + teststringobj set 2 abca + teststringobj getunicode 1 + teststringobj getunicode 2 + string compare -nocase [teststringobj get 1] [teststringobj get 2] + } \ + -cleanup { + testobj freeallvars + } \ + -result 1 # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12