doxygen/tests/upstream-test-suite/062_namespace_resolution.tcl
Petr Šabata 32cf374a4b RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/doxygen#6b0c5db74b337b843ad543bf84325b6e1ef5d040
2020-10-14 23:50:45 +02:00

69 lines
1.6 KiB
Tcl

#// objective: tests correct namespace resolution, only references/referencedby relations are relevant
#// check: namespacen1.xml
#// check: namespacen2.xml
#// check: namespacen3.xml
#// config: REFERENCED_BY_RELATION = yes
#// config: REFERENCES_RELATION = yes
#// config: EXTRACT_ALL = yes
#// config: INLINE_SOURCES = yes
# now: combine namespace eval and qualified names
namespace eval n1 {
proc p1 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
p2
return
}
proc p2 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
return
}
namespace eval n1 {
proc p1 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
return
}
}
}
# same thing, but fully qualified proc names
namespace eval ::n2 {}
namespace eval ::n2::n2 {}
proc ::n2::p1 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
p2
return
}
proc ::n2::p2 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
return
}
proc ::n2::n2::p2 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
return
}
# same thing, without leading ::
namespace eval n3 {}
namespace eval n3::n3 {}
proc n3::p1 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
p2
return
}
proc n3::p2 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
return
}
proc n3::n3::p2 args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
return
}
# now, check with tcl what is called
n1::p1
puts ""
n2::p1
puts ""
n3::p1
puts ""
exit