mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-01 17:57:25 +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:
parent
c6fce30e9b
commit
5adfac9fc3
2 changed files with 5 additions and 1 deletions
|
|
@ -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]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue