mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-05-20 07:00:41 +00:00
improved buildExposureValues
testing
This commit is contained in:
parent
31a429b423
commit
d55801c294
2 changed files with 382 additions and 75 deletions
|
@ -176,20 +176,7 @@ class MeteringContainerBuidler extends StatelessWidget {
|
||||||
/// But user can exclude this value from the list using custom equipment profile.
|
/// But user can exclude this value from the list using custom equipment profile.
|
||||||
/// So we have to restore the index of the anchor value.
|
/// So we have to restore the index of the anchor value.
|
||||||
const anchorShutterSpeed = ShutterSpeedValue(1, false, StopType.full);
|
const anchorShutterSpeed = ShutterSpeedValue(1, false, StopType.full);
|
||||||
int anchorIndex = shutterSpeedValues.indexOf(anchorShutterSpeed);
|
final int anchorIndex = shutterSpeedValues.indexOf(anchorShutterSpeed);
|
||||||
if (anchorIndex < 0) {
|
|
||||||
final filteredFullList = ShutterSpeedValue.values.whereStopType(stopType);
|
|
||||||
final customListStartIndex = filteredFullList.indexOf(shutterSpeedValues.first);
|
|
||||||
final fullListAnchor = filteredFullList.indexOf(anchorShutterSpeed);
|
|
||||||
if (customListStartIndex < fullListAnchor) {
|
|
||||||
/// This means, that user excluded anchor value at the end,
|
|
||||||
/// i.e. all shutter speed values are shorter than 1".
|
|
||||||
anchorIndex = fullListAnchor - customListStartIndex;
|
|
||||||
} else {
|
|
||||||
/// In case user excludes anchor value at the start,
|
|
||||||
/// we can do no adjustment.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final int evOffset = anchorIndex - evSteps;
|
final int evOffset = anchorIndex - evSteps;
|
||||||
|
|
||||||
late final int apertureOffset;
|
late final int apertureOffset;
|
||||||
|
@ -208,7 +195,7 @@ class MeteringContainerBuidler extends StatelessWidget {
|
||||||
) -
|
) -
|
||||||
max(apertureOffset, shutterSpeedOffset);
|
max(apertureOffset, shutterSpeedOffset);
|
||||||
|
|
||||||
if (itemsCount < 0) {
|
if (itemsCount <= 0) {
|
||||||
return List.empty();
|
return List.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,10 @@ void main() {
|
||||||
test('isInifinity', () {
|
test('isInifinity', () {
|
||||||
expect(exposurePairsFull(double.infinity), const []);
|
expect(exposurePairsFull(double.infinity), const []);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Big ass number', () {
|
||||||
|
expect(exposurePairsFull(23), const []);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
group('Default equipment profile', () {
|
group('Default equipment profile', () {
|
||||||
|
@ -333,13 +337,16 @@ void main() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
group('Reduced equipment profile', () {
|
group('Shutter speed 1/1000-1/2"', () {
|
||||||
final equipmentProfile = EquipmentProfile(
|
final equipmentProfile = EquipmentProfile(
|
||||||
id: "1",
|
id: "1",
|
||||||
name: 'Test1',
|
name: 'Test1',
|
||||||
apertureValues: ApertureValue.values.sublist(4),
|
apertureValues: ApertureValue.values,
|
||||||
ndValues: NdValue.values,
|
ndValues: NdValue.values,
|
||||||
shutterSpeedValues: ShutterSpeedValue.values.sublist(0, ShutterSpeedValue.values.length - 4),
|
shutterSpeedValues: ShutterSpeedValue.values.sublist(
|
||||||
|
ShutterSpeedValue.values.indexOf(const ShutterSpeedValue(1000, true, StopType.full)),
|
||||||
|
ShutterSpeedValue.values.indexOf(const ShutterSpeedValue(2, true, StopType.full)) + 1,
|
||||||
|
),
|
||||||
isoValues: IsoValue.values,
|
isoValues: IsoValue.values,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -357,15 +364,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -375,15 +382,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -393,15 +400,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(2, true, StopType.full),
|
ShutterSpeedValue(4, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(5.6, StopType.full),
|
ApertureValue(1.4, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -411,15 +418,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(2, true, StopType.full),
|
ShutterSpeedValue(4, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(5.6, StopType.full),
|
ApertureValue(1.4, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -429,15 +436,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(2, true, StopType.full),
|
ShutterSpeedValue(4, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(5.6, StopType.full),
|
ApertureValue(1.4, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -457,15 +464,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4.0, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -475,15 +482,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1.5, true, StopType.half),
|
ShutterSpeedValue(3, true, StopType.half),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4.8, StopType.full),
|
ApertureValue(1.2, StopType.half),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -493,15 +500,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1.5, true, StopType.half),
|
ShutterSpeedValue(3, true, StopType.half),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4.8, StopType.full),
|
ApertureValue(1.2, StopType.half),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -511,15 +518,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1.5, true, StopType.full),
|
ShutterSpeedValue(3, true, StopType.half),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4.8, StopType.full),
|
ApertureValue(1.2, StopType.half),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -529,15 +536,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(2, true, StopType.full),
|
ShutterSpeedValue(4, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(5.6, StopType.full),
|
ApertureValue(1.4, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -557,15 +564,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -575,15 +582,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1.3, true, StopType.third),
|
ShutterSpeedValue(2.5, true, StopType.third),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(4.5, StopType.third),
|
ApertureValue(1.1, StopType.third),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -593,15 +600,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1.6, true, StopType.third),
|
ShutterSpeedValue(3, true, StopType.third),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(5.0, StopType.third),
|
ApertureValue(1.2, StopType.third),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -611,15 +618,15 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.0, StopType.full),
|
||||||
ShutterSpeedValue(1.6, true, StopType.third),
|
ShutterSpeedValue(3, true, StopType.third),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(5.0, StopType.third),
|
ApertureValue(1.2, StopType.third),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -628,16 +635,329 @@ void main() {
|
||||||
final exposurePairs = exposurePairsFull(2);
|
final exposurePairs = exposurePairsFull(2);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.first,
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(1.0, StopType.full),
|
||||||
|
ShutterSpeedValue(4, true, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(1.4, StopType.full),
|
ApertureValue(1.4, StopType.full),
|
||||||
ShutterSpeedValue(2, true, StopType.full),
|
ShutterSpeedValue(2, true, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
group('Shutter speed 2"-16"', () {
|
||||||
|
final equipmentProfile = EquipmentProfile(
|
||||||
|
id: "1",
|
||||||
|
name: 'Test1',
|
||||||
|
apertureValues: ApertureValue.values.sublist(4),
|
||||||
|
ndValues: NdValue.values,
|
||||||
|
shutterSpeedValues: ShutterSpeedValue.values.sublist(
|
||||||
|
ShutterSpeedValue.values.indexOf(const ShutterSpeedValue(2, false, StopType.full)),
|
||||||
|
),
|
||||||
|
isoValues: IsoValue.values,
|
||||||
|
);
|
||||||
|
|
||||||
|
group("StopType.full", () {
|
||||||
|
List<ExposurePair> exposurePairsFull(double ev) =>
|
||||||
|
MeteringContainerBuidler.buildExposureValues(
|
||||||
|
ev,
|
||||||
|
StopType.full,
|
||||||
|
equipmentProfile,
|
||||||
|
const Film.other(),
|
||||||
|
);
|
||||||
|
|
||||||
|
test('EV 1', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.0, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
expect(
|
expect(
|
||||||
exposurePairs.last,
|
exposurePairs.last,
|
||||||
const ExposurePair(
|
const ExposurePair(
|
||||||
ApertureValue(5.6, StopType.full),
|
ApertureValue(5.6, StopType.full),
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.3', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.3);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.0, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(5.6, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.5', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.5);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.8, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(8, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.7', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.7);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.8, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(8, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 2', () {
|
||||||
|
final exposurePairs = exposurePairsFull(2);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.8, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(8, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
group("StopType.half", () {
|
||||||
|
List<ExposurePair> exposurePairsFull(double ev) =>
|
||||||
|
MeteringContainerBuidler.buildExposureValues(
|
||||||
|
ev,
|
||||||
|
StopType.half,
|
||||||
|
equipmentProfile,
|
||||||
|
const Film.other(),
|
||||||
|
);
|
||||||
|
|
||||||
|
test('EV 1', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.0, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(5.6, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.3', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.3);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.4, StopType.half),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(6.7, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.5', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.5);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.4, StopType.half),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(6.7, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.7', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.7);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.4, StopType.half),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(6.7, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 2', () {
|
||||||
|
final exposurePairs = exposurePairsFull(2);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.8, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(8, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
group("StopType.third", () {
|
||||||
|
List<ExposurePair> exposurePairsFull(double ev) =>
|
||||||
|
MeteringContainerBuidler.buildExposureValues(
|
||||||
|
ev,
|
||||||
|
StopType.third,
|
||||||
|
equipmentProfile,
|
||||||
|
const Film.other(),
|
||||||
|
);
|
||||||
|
|
||||||
|
test('EV 1', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.0, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(5.6, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.3', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.3);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.2, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(6.3, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.5', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.5);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.4, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(7.1, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 1.7', () {
|
||||||
|
final exposurePairs = exposurePairsFull(1.7);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.4, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.third),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(7.1, StopType.third),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('EV 2', () {
|
||||||
|
final exposurePairs = exposurePairsFull(2);
|
||||||
|
expect(
|
||||||
|
exposurePairs.first,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(2.8, StopType.full),
|
||||||
|
ShutterSpeedValue(2, false, StopType.full),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
exposurePairs.last,
|
||||||
|
const ExposurePair(
|
||||||
|
ApertureValue(8, StopType.full),
|
||||||
|
ShutterSpeedValue(16, false, StopType.full),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue