mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
dart: Fix incorrect write in Float64 write method (#8290)
Co-authored-by: Llamadmiral <Llamadmiral@users.noreply.github.com> Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -386,7 +386,7 @@ class Builder {
|
||||
/// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer.
|
||||
void putFloat64(double value) {
|
||||
_prepare(_sizeofFloat64, 1);
|
||||
_setFloat32AtTail(_tail, value);
|
||||
_setFloat64AtTail(_tail, value);
|
||||
}
|
||||
|
||||
/// Writes a Float32 to the tail of the buffer after preparing space for it.
|
||||
|
||||
@@ -215,6 +215,10 @@ class BuilderTest {
|
||||
..addTestarrayofstringOffset(testArrayOfString);
|
||||
final mon = monBuilder.finish();
|
||||
fbBuilder.finish(mon);
|
||||
|
||||
final mon3 = example.Monster(fbBuilder.buffer);
|
||||
expect(mon3.name, 'MyMonster');
|
||||
expect(mon3.pos!.test1, 3.0);
|
||||
}
|
||||
|
||||
void test_error_addInt32_withoutStartTable([Builder? builder]) {
|
||||
|
||||
Reference in New Issue
Block a user