Itcl - the [incr Tcl] extension

Check-in [ae5616de01]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:more tests illustrating [1dc2d851eb]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bug-1dc2d851eb
Files: files | file ages | folders
SHA3-256: ae5616de01fd622f57fe9e69da00bd5b775da3c0a2d6af5c8287ab8130484fb9
User & Date: sebres 2019-02-08 20:50:23.665
Context
2019-02-08
21:18
fix [1dc2d851eb] case "sfbug-254.1" - Tcl_GetObjectFromObj/Tcl_GetObjectAsClass could return NULL (without oo-machinery), test passed now check-in: bc31e1da48 user: sebres tags: bug-1dc2d851eb
20:50
more tests illustrating [1dc2d851eb] check-in: ae5616de01 user: sebres tags: bug-1dc2d851eb
17:34
test case extended to cover [1dc2d851eb] (segfault by creating of itc-class after deleting of oo::class machinery) check-in: af671ed22c user: sebres tags: bug-1dc2d851eb
Changes
Unified Diff Ignore Whitespace Patch
Changes to tests/sfbugs.test.
267
268
269
270
271
272
273
274
275
276





















277
278
279
280
281

282


283


284
285
286
287
288
289
290
291
292
293
294
       }
    }

    [foo #auto] kerplunk hello world
} -result {{foo0 kerplunk hello world} {foo0 kerplunk hello world} {foo0 kerplunk hello world}} \
  -cleanup {::itcl::delete class foo}

test sfbug-254 { SF bug #254 + bug [1dc2d851eb]
} -body {
    set interp [interp create]





















    $interp eval {
      package require itcl

      set ::test_status ""
      oo::class destroy

      lappend ::test_status "::oo::class destroy worked"


      ::itcl::class ::test {}


      lappend ::test_status "::itcl::class worked"
    }
} -result {{::oo::class destroy worked} {::itcl::class worked}} \
  -cleanup { }

test sfbug-255 { SF bug #255
} -body {
    set ::test_status ""

    proc ::sfbug_255_do_uplevel { body } {
        uplevel 1 $body







|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



<

>
|
>
>
|
>
>
|

|
|







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300

301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
       }
    }

    [foo #auto] kerplunk hello world
} -result {{foo0 kerplunk hello world} {foo0 kerplunk hello world} {foo0 kerplunk hello world}} \
  -cleanup {::itcl::delete class foo}

test sfbug-254.1 { SF bug #254 + bug [1dc2d851eb]
} -body {
    set interp [interp create]
    set ::test_status ""
    $interp eval {
      oo::class destroy
    }
    lappend ::test_status "::oo::class destroy worked"
    if {[catch {
      $interp eval [::tcltest::loadScript]
      $interp eval {
        package require itcl
      }
    } msg]} {
      lappend ::test_status $msg
    }
} -result {{::oo::class destroy worked} {::oo::class does not refer to an object}} \
  -cleanup {interp delete $interp}

test sfbug-254.2 { SF bug #254 + bug [1dc2d851eb]
} -body {
    set interp [interp create]
    set ::test_status ""
    $interp eval [::tcltest::loadScript]
    $interp eval {
      package require itcl


      oo::class destroy
    }
    lappend ::test_status "::oo::class destroy worked"
    if {[catch {
      $interp eval {
        ::itcl::class ::test {}
      }
    } msg]} {
      lappend ::test_status $msg
    }
} -result {{::oo::class destroy worked} {::test does not refer to a class}} \
  -cleanup {interp delete $interp}

test sfbug-255 { SF bug #255
} -body {
    set ::test_status ""

    proc ::sfbug_255_do_uplevel { body } {
        uplevel 1 $body
365
366
367
368
369
370
371

372
373
374
375
376
377
378
    [::sfbug_256_testclass tc] api-call
} -result {TestClass::api-call TestClass::internal-helper value {TestClass::api-call TestClass::internal-helper value} TestClass::internal-helper value {TestClass::api-call TestClass::internal-helper value {TestClass::api-call TestClass::internal-helper value} TestClass::internal-helper value} value value} \
  -cleanup {::itcl::delete class TestClass256}

test sfbug-257 { SF bug #257
} -body {
    set interp [interp create]

    $interp eval {
      package require itcl
      set ::test_status ""
      ::itcl::class ::cl1 {
        method m1 {} {
          ::oo::class destroy
          lappend ::test_status "method Hello World"







>







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
    [::sfbug_256_testclass tc] api-call
} -result {TestClass::api-call TestClass::internal-helper value {TestClass::api-call TestClass::internal-helper value} TestClass::internal-helper value {TestClass::api-call TestClass::internal-helper value {TestClass::api-call TestClass::internal-helper value} TestClass::internal-helper value} value value} \
  -cleanup {::itcl::delete class TestClass256}

test sfbug-257 { SF bug #257
} -body {
    set interp [interp create]
    $interp eval [::tcltest::loadScript]
    $interp eval {
      package require itcl
      set ::test_status ""
      ::itcl::class ::cl1 {
        method m1 {} {
          ::oo::class destroy
          lappend ::test_status "method Hello World"