Objects created on the stack (like your "test") go out of scope when the block they are declared in ends.