~sircmpwn/hare-bcrypt

e491b154aa276ec0b796e3f339fc212b09aef077 — Martin Quinson 7 months ago d15c920
Fix 102 memleaks in the stdlib tests

992 memleaks remain, but I prefer to break this change in parts to
ease the reviewing work.

Signed-off-by: Martin Quinson <martin.quinson@ens-rennes.fr>
1 files changed, 2 insertions(+), 0 deletions(-)

M +test.ha
M +test.ha => +test.ha +2 -0
@@ 7,6 7,7 @@ use strings;
@test fn bcrypt() void = {
	const pass = strings::toutf8("hare is cool");
	const hash = generate(pass, DEFAULT_COST);
	defer free(hash);
	assert(compare(hash, pass)!);
	const notpass = strings::toutf8("hare is lame");
	assert(!compare(hash, notpass)!);


@@ 18,5 19,6 @@ use strings;
	const expect = "$2a$10$XajjQvNhvvRt5GSeFk1xFeyqRrsxkhBkUiQeg0dt.wU1qD4aFDcga";

	const hash = strings::fromutf8(bcrypt(pass, salt, 10)!)!;
	defer free(hash);
	assert(strings::hassuffix(expect, hash));
};