refactor!: use Finalizer to automatically free allocated memory for objects

BREAKING CHANGE: signature change for remote and repository callbacks
during repository clone operation.
This commit is contained in:
Aleksey Kulikov 2022-04-21 14:07:11 +03:00
parent 94c40f9a94
commit b589097c8c
73 changed files with 1073 additions and 1618 deletions

View file

@ -16,9 +16,6 @@ void main() {
);
});
tearDown(() {
signature.free();
});
group('Signature', () {
test('creates with provided time and offset', () {
expect(signature, isA<Signature>());
@ -50,7 +47,6 @@ void main() {
lessThan(5),
);
expect(sig.offset, isA<int>());
sig.free();
});
test('returns correct values', () {
@ -66,9 +62,16 @@ void main() {
email: email,
time: time,
);
expect(signature == otherSignature, true);
expect(signature, equals(otherSignature));
});
otherSignature.free();
test('manually releases allocated memory', () {
final signature = Signature.create(
name: name,
email: email,
time: time,
);
expect(() => signature.free(), returnsNormally);
});
test('returns string representation of Signature object', () {