Add using to disposable Mats
MODIFY
WalletWasabi.Tests/UnitTests/QrDecode/QrCodeDecodingTests.cs
WalletWasabi.Tests/UnitTests/QrDecode/QrCodeDecodingTests.cs
@@ -17,7 +17,7 @@ namespace WalletWasabi.Tests.UnitTests.QrDecode
string otherExpectedAddress = "tb1qfas0k9rn8daqggu7wzp2yne9qdd5fr5wf2u478";
string path = Path.Combine(_commonPartialPath, "AddressTest1.png");
- var qrImage = new Mat(path);
+ using var qrImage = new Mat(path);
bool qrFound = decoder.Detect(new Mat(path), out var points);
Assert.True(qrFound);
@@ -25,7 +25,7 @@ namespace WalletWasabi.Tests.UnitTests.QrDecode
Assert.Equal(expectedAddress, address);
string otherPath = Path.Combine(_commonPartialPath, "AddressTest2.png");
- var secondQrImage = new Mat(otherPath);
+ using var secondQrImage = new Mat(otherPath);
qrFound = decoder.Detect(secondQrImage, out var otherPoints);
Assert.True(qrFound);
@@ -40,7 +40,7 @@ namespace WalletWasabi.Tests.UnitTests.QrDecode
string expectedOutput = "tb1qutgpgraaze3hqnvt2xyw5acsmd3urprk3ff27d";
string path = Path.Combine(_commonPartialPath, "QrByPhone.jpg");
- var qrImage = new Mat(path);
+ using var qrImage = new Mat(path);
bool qrFound = decoder.Detect(new Mat(path), out var points);
Assert.True(qrFound);
@@ -55,7 +55,7 @@ namespace WalletWasabi.Tests.UnitTests.QrDecode
string expectedOutput = "Let's see a Zebra.";
string path = Path.Combine(_commonPartialPath, "QRwithZebraBackground.png");
- var qrImage = new Mat(path);
+ using var qrImage = new Mat(path);
bool qrFound = decoder.Detect(new Mat(path), out var points);
Assert.True(qrFound);
@@ -70,7 +70,7 @@ namespace WalletWasabi.Tests.UnitTests.QrDecode
string expectedOutput = "https://twitter.com/SimonHearne";
string path = Path.Combine(_commonPartialPath, "qr-embed-logos.png");
- var qrImage = new Mat(path);
+ using var qrImage = new Mat(path);
bool qrFound = decoder.Detect(new Mat(path), out var points);
Assert.True(qrFound);

Add using to disposable Mats