Software /
code /
prosody
Annotate
tests/test_core_s2smanager.lua @ 517:afd9f6590fd0
lxmppd -> Prosody
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 03 Dec 2008 13:02:23 +0000 |
parent | 363:a43edbc848b9 |
child | 519:cccd610a0ef9 |
rev | line source |
---|---|
363
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 function compare_srv_priorities(csp) |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 local r1 = { priority = 10, weight = 0 } |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 local r2 = { priority = 100, weight = 0 } |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 local r3 = { priority = 1000, weight = 2 } |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 local r4 = { priority = 1000, weight = 2 } |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 local r5 = { priority = 1000, weight = 5 } |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 assert_equal(csp(r1, r1), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 assert_equal(csp(r1, r2), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 assert_equal(csp(r1, r3), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 assert_equal(csp(r1, r4), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 assert_equal(csp(r1, r5), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 assert_equal(csp(r2, r1), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 assert_equal(csp(r2, r2), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 assert_equal(csp(r2, r3), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 assert_equal(csp(r2, r4), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 assert_equal(csp(r2, r5), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 assert_equal(csp(r3, r1), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 assert_equal(csp(r3, r2), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 assert_equal(csp(r3, r3), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 assert_equal(csp(r3, r4), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 assert_equal(csp(r3, r5), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 assert_equal(csp(r4, r1), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 assert_equal(csp(r4, r2), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 assert_equal(csp(r4, r3), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 assert_equal(csp(r4, r4), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 assert_equal(csp(r4, r5), true); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
32 assert_equal(csp(r5, r1), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 assert_equal(csp(r5, r2), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 assert_equal(csp(r5, r3), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
35 assert_equal(csp(r5, r4), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
36 assert_equal(csp(r5, r5), false); |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
37 |
a43edbc848b9
Oops, never added the tests for s2smanager to the repo
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
38 end |