You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @khoren93 I am wondering if there is a way to run unit tests on known images, as a way to ensure that the barcode scanning functionality does not "regress" across release cycles.
And trying to run the following code in a unit test:
/* * Helper function to read a barcode from an image file */Future<zxing.Code> readBarcodeFromImage(String path) async {
// Load file from provided pathfinalXFile imageFile =XFile("test_resources/$path");
final zxing.DecodeParams params = zxing.DecodeParams(
imageFormat: zxing.ImageFormat.rgb,
tryHarder:true,
tryRotate:true,
tryInverted:true,
isMultiScan:false,
);
final zxing.Code code =await zxing.zxingReadBarcodeImagePath(imageFile, params);
debugDefaultTargetPlatformOverride =null;
return code;
}
voidmain() {
TestWidgetsFlutterBinding.ensureInitialized();
group("Test Barcodes:", () {
debugDefaultTargetPlatformOverride =TargetPlatform.android;
test("Code-39", () async {
final zxing.Code code =awaitreadBarcodeFromImage("code-39.png");
expect(code, isNotNull);
expect(code.text, "012345678905");
});
});
}
However, I run into this error, I believe because the test is being run on a windows machine, and not respecting the target platform (Android) in this case?
Invalid argument(s): Failed to load dynamic library 'flutter_zxing.dll': The specified module could not be found.
(error code: 126)
dart:ffi new DynamicLibrary.open
package:flutter_zxing/src/logic/bindings.dart 10:27 _openDynamicLibrary
package:flutter_zxing/src/logic/bindings.dart 15:24 dylib
package:flutter_zxing/src/logic/bindings.dart dylib
package:flutter_zxing/src/logic/bindings.dart 3:54 bindings
package:flutter_zxing/src/logic/bindings.dart bindings
package:flutter_zxing/src/logic/barcode_reader.dart 40:5 _readBarcode
package:flutter_zxing/src/logic/barcode_reader.dart 37:5 zxingReadBarcode
package:flutter_zxing/src/logic/barcode_reader.dart 18:10 zxingReadBarcodeImagePath
The text was updated successfully, but these errors were encountered:
Hi @khoren93 I am wondering if there is a way to run unit tests on known images, as a way to ensure that the barcode scanning functionality does not "regress" across release cycles.
For reference, I am using this library in https://github.com/inventree/inventree-app/
And trying to run the following code in a unit test:
However, I run into this error, I believe because the test is being run on a windows machine, and not respecting the target platform (Android) in this case?
The text was updated successfully, but these errors were encountered: