refactor!: use Finalizer to automatically free allocated memory for objects (#48)

BREAKING CHANGE: signature change for remote and repository callbacks during repository clone operation.
This commit is contained in:
Aleksey Kulikov 2022-04-28 11:04:48 +03:00 committed by GitHub
parent 94c40f9a94
commit a3213a88a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 2278 additions and 2595 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', () {