diff options
author | Kevin B Kenny <kennykb@acm.org> | 2007-05-02 01:37:28 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2007-05-02 01:37:28 (GMT) |
commit | f7a689954d82d07cfd1e77353edbfb7ef96fafd6 (patch) | |
tree | d6872063b78f6f9c99c9ef9e61339e55608299fe /tests | |
parent | e363ced3b4481084d34d11085cfd95b2bf71fe6c (diff) | |
download | tcl-f7a689954d82d07cfd1e77353edbfb7ef96fafd6.zip tcl-f7a689954d82d07cfd1e77353edbfb7ef96fafd6.tar.gz tcl-f7a689954d82d07cfd1e77353edbfb7ef96fafd6.tar.bz2 |
* 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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/utf.test | 100 |
1 files changed, 67 insertions, 33 deletions
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: |