about summary refs log tree commit diff stats
path: root/tests/test_cmd_rooms.h
blob: a9a7af832842e42e1e48ac825b0909c1c1ff478c (plain) (blame)
1
2
3
4
5
6
7
void cmd_rooms_shows_message_when_disconnected(void **state);
void cmd_rooms_shows_message_when_disconnecting(void **state);
void cmd_rooms_shows_message_when_connecting(void **state);
void cmd_rooms_shows_message_when_started(void **state);
void cmd_rooms_shows_message_when_undefined(void **state);
void cmd_rooms_uses_account_default_when_no_arg(void **state);
void cmd_rooms_arg_used_when_passed(void **state);
>) for k, v in d.items() if v is not 0) def b(d): for k, v in d.copy().items(): if v == 0: del d[k] return d def c(d): for k in tuple(d.keys()): if d[k] == 0: del d[k] return d def d(d): for k, v in tuple(d.items()): if v == 0: del d[k] return d basedict = {} for i in range(200): basedict[i] = random.randint(0, 1) expected = DelValue.a(basedict.copy()) for algo in ['a', 'b', 'c', 'd']: copy = basedict.copy() t = time.time() for i in range(100): assert DelValue.__dict__[algo](copy) == expected print("algorithm %s: %f" % (algo, time.time() - t)) # c it is, although b is faster with smaller dictionaries