#!/usr/bin/env python
import coral ; metamodel=coral.lang.UML14

i = metamodel.Class.__properties__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)



c = metamodel.Class()
i = c.__properties__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)



c = metamodel.Class()
i = c.__all_slots__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)


i = metamodel.Class.__superclasses__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)



i = metamodel.Class.__subclasses__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)



i = metamodel.__elements__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)
i = i.__iter__()
assert(i.get_ref_count() == 1)

i = metamodel.Class()
assert(i.get_ref_count() == 1)

# 
# BUG we should check that the iterators are also deleted by the
# cache...
#
