OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [itcl/] [tests/] [old/] [AAA.test] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#
2
# AAA - first test executed in test suite
3
# ----------------------------------------------------------------------
4
#   AUTHOR:  Michael J. McLennan
5
#            Bell Labs Innovations for Lucent Technologies
6
#            mmclennan@lucent.com
7
#            http://www.tcltk.com/itcl
8
#
9
#      RCS:  $Id: AAA.test,v 1.1.1.1 2002-01-16 10:24:47 markom Exp $
10
# ----------------------------------------------------------------------
11
#            Copyright (c) 1993-1998  Lucent Technologies, Inc.
12
# ======================================================================
13
# See the file "license.terms" for information on usage and
14
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
 
16
# ----------------------------------------------------------------------
17
#  SHOULD HAVE A CLEAN SLATE
18
# ----------------------------------------------------------------------
19
test {No object info (no classes)} {
20
        itcl_info classes
21
} {
22
        $result == ""
23
}
24
 
25
test {No object info (no objects)} {
26
        itcl_info objects
27
} {
28
        $result == ""
29
}
30
 
31
# ----------------------------------------------------------------------
32
#  TEST CLASS AUTO-LOADING
33
# ----------------------------------------------------------------------
34
test {Force auto-loading through inheritance} {
35
        FooBar x
36
} {
37
        $result == "x"
38
}
39
 
40
test {Info: all classes} {
41
        itcl_info classes
42
} {
43
        [test_cmp_lists $result {Foo Bar FooBar}]
44
}
45
 
46
test {Info: all classes matching a pattern} {
47
        itcl_info classes *oo*
48
} {
49
        [test_cmp_lists $result {Foo FooBar}]
50
}
51
 
52
# ----------------------------------------------------------------------
53
#  OBJECT AUTO-NUMBERING
54
# ----------------------------------------------------------------------
55
test {Create object with auto-naming} {
56
        FooBar #auto -blit x
57
} {
58
        $result == "fooBar0" && [fooBar0 info public blit -value] == "x"
59
}
60
 
61
test {Create object with auto-naming} {
62
        FooBar #auto -blit y
63
} {
64
        $result == "fooBar1" && [fooBar1 info public blit -value] == "y"
65
}
66
 
67
test {Auto-naming should avoid names already in use} {
68
        FooBar fooBar2
69
        FooBar fooBar3
70
        FooBar fooBar4
71
        FooBar #auto
72
} {
73
        $result == "fooBar5"
74
}
75
 
76
test {Destroy all outstanding objects} {
77
        foreach obj [itcl_info objects] {
78
                $obj delete
79
        }
80
} {
81
        $result == ""
82
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.