self-test, always call clear_keys before adding new keys