Skip to content

Commit

Permalink
Fixed rnd.wany unstable behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMirzayanov committed Sep 26, 2023
1 parent 7a5a0a4 commit 525e696
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions testlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ class random_t {
/* Returns weighted random element from container. */
template<typename Container>
typename Container::value_type wany(const Container &c, int type) {
size_t size = c.size();
int size = int(c.size());
if (size <= 0)
__testlib_fail("random_t::wany(const Container& c, int type): c.size() must be positive");
return *(c.begin() + wnext(size, type));
Expand Down Expand Up @@ -4415,7 +4415,7 @@ void registerGen(int argc, char *argv[]) {
}
#endif

static void setAppesModeEncoding(std::string appesModeEncoding) {
void setAppesModeEncoding(std::string appesModeEncoding) {
static const char* const ENCODINGS[] = {"ascii", "utf-7", "utf-8", "utf-16", "utf-16le", "utf-16be", "utf-32", "utf-32le", "utf-32be", "iso-8859-1",
"iso-8859-2", "iso-8859-3", "iso-8859-4", "iso-8859-5", "iso-8859-6", "iso-8859-7", "iso-8859-8", "iso-8859-9", "iso-8859-10", "iso-8859-11",
"iso-8859-13", "iso-8859-14", "iso-8859-15", "iso-8859-16", "windows-1250", "windows-1251", "windows-1252", "windows-1253", "windows-1254", "windows-1255",
Expand Down
6 changes: 3 additions & 3 deletions tests/test-003_run-rnd/refs/r1/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ vutwaahqooeqoxzxwetlpecqiwgdbogiqqulttysyohwhzxzphvsfmnplizxoebzcvvfyppqbhxjksuz
1880
1973
1850
2916
1444
g
2116
441
e
6 changes: 3 additions & 3 deletions tests/test-003_run-rnd/refs/r2/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ clizwkchataumicxkohcrpqnyrjyzbjvsypznpembvkkkbyzvzckcmhbjbuopfbwbkntswhwsdfzabjg
1363
1897
1175
8281
6084
a
3249
3481
e

0 comments on commit 525e696

Please sign in to comment.