rename project. lean it up. validate image stream test works.
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:archimedes_mobile_lib/archimedes_c_shim.dart';
|
||||
import 'package:archimedes_mobile_lib/dynloader.dart';
|
||||
import 'package:archimedes_mobile_lib/util.dart';
|
||||
import 'package:dart_openmvg/openmvg_c_shim.dart';
|
||||
import 'package:dart_openmvg/dynloader.dart';
|
||||
import 'package:dart_openmvg/util.dart';
|
||||
import 'package:ffi/ffi.dart';
|
||||
import 'package:test/test.dart';
|
||||
import "package:path/path.dart" show dirname, join;
|
||||
|
||||
final assets = join(HERE.parent.path, "assets");
|
||||
final assets = join(HERE.path, "assets");
|
||||
final testFrames = join(assets, "test", "frames");
|
||||
final firstFrame = join(testFrames, "0001.png");
|
||||
|
||||
@ -20,8 +20,17 @@ void main() {
|
||||
// Tear down code
|
||||
});
|
||||
test('newFrame', () {
|
||||
Uint8FlexList frameData = readUint8Ptr(File(firstFrame));
|
||||
newFrame(frameData.pointer, frameData.length, 768, 768, 1204);
|
||||
final frameData = readUint8Ptr(File(firstFrame));
|
||||
final frame = newFrame(frameData.ptr, frameData.length, 768, 768, 1204);
|
||||
expect(frame.ref.h, 768);
|
||||
expect(frame.ref.w, 768);
|
||||
expect(frame.ref.h, 768);
|
||||
final data = getImageData(frame);
|
||||
expect(data.ref.error, 0);
|
||||
|
||||
// clean up the memory. ;-)
|
||||
calloc.free(data);
|
||||
calloc.free(frame);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user