summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-10-29 13:27:59 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-10-29 13:27:59 +0300
commit86c4f76c512507eb6f5a9fd563061d7f9b2c8598 (patch)
tree073654fbab39e03450bf43394d1fc41a1b6aeb13 /test
parentEscape 'family' field in SQL requests (diff)
Avoid using 64-bit unsigned integers
Diffstat (limited to 'test')
-rw-r--r--test/offline_tests.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/offline_tests.erl b/test/offline_tests.erl
index be437d41..6c6a924c 100644
--- a/test/offline_tests.erl
+++ b/test/offline_tests.erl
@@ -77,11 +77,11 @@ send_non_existent(Config) ->
disconnect(Config).
view_non_existent(Config) ->
- #stanza_error{reason = 'item-not-found'} = view(Config, [p1_rand:get_string()], false),
+ #stanza_error{reason = 'item-not-found'} = view(Config, [rand_string()], false),
disconnect(Config).
remove_non_existent(Config) ->
- ok = remove(Config, [p1_rand:get_string()]),
+ ok = remove(Config, [rand_string()]),
disconnect(Config).
view_non_integer(Config) ->
@@ -93,7 +93,7 @@ remove_non_integer(Config) ->
disconnect(Config).
malformed_iq(Config) ->
- Item = #offline_item{node = p1_rand:get_string()},
+ Item = #offline_item{node = rand_string()},
Range = [{Type, SubEl} || Type <- [set, get],
SubEl <- [#offline{items = [], _ = false},
#offline{items = [Item], _ = true}]]
@@ -112,7 +112,7 @@ malformed_iq(Config) ->
wrong_user(Config) ->
Server = ?config(server, Config),
To = jid:make(<<"foo">>, Server),
- Item = #offline_item{node = p1_rand:get_string()},
+ Item = #offline_item{node = rand_string()},
Range = [{Type, Items, Purge, Fetch} ||
Type <- [set, get],
Items <- [[], [Item]],
@@ -130,7 +130,7 @@ wrong_user(Config) ->
disconnect(Config).
unsupported_iq(Config) ->
- Item = #offline_item{node = p1_rand:get_string()},
+ Item = #offline_item{node = rand_string()},
lists:foreach(
fun(Type) ->
#iq{type = error} = Err =
@@ -495,7 +495,7 @@ message_iterator(Config) ->
Offline = [[#offline{}]],
Hints = [[#hint{type = T}] || T <- [store, 'no-store']],
XEvent = [[#xevent{id = ID, offline = OfflineFlag}]
- || ID <- [undefined, p1_rand:get_string()],
+ || ID <- [undefined, rand_string()],
OfflineFlag <- [false, true]],
Delay = [[#delay{stamp = p1_time_compat:timestamp(), from = ServerJID}]],
AllEls = [Els1 ++ Els2 || Els1 <- [[]] ++ ChatStates ++ Delay ++ Hints ++ Offline,
@@ -520,3 +520,6 @@ message_iterator(Config) ->
(#message{type = Type}) -> (Type == chat) or (Type == normal);
(_) -> false
end, All).
+
+rand_string() ->
+ integer_to_binary(p1_rand:uniform((1 bsl 63)-1)).