Skip to content

Commit

Permalink
fix go cases
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Oct 8, 2024
1 parent 0b5e86f commit 9ac2373
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bindings/c/tests/bdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TEST_F(OpendalBddTest, FeatureTest)
.data = (uint8_t*)this->content.c_str(),
.len = this->content.length(),
};
opendal_error* error = opendal_operator_write(this->p, this->path.c_str(), data);
opendal_error* error = opendal_operator_write(this->p, this->path.c_str(), &data);
EXPECT_EQ(error, nullptr);

// The blocking file "test" should exist
Expand Down Expand Up @@ -99,7 +99,7 @@ TEST_F(OpendalBddTest, FeatureTest)

opendal_result_operator_writer writer = opendal_operator_writer(this->p, this->path.c_str());
EXPECT_EQ(writer.error, nullptr);
opendal_result_writer_write w = opendal_writer_write(writer.writer, data);
opendal_result_writer_write w = opendal_writer_write(writer.writer, &data);
EXPECT_EQ(w.error, nullptr);
EXPECT_EQ(w.size, this->content.length());
opendal_writer_free(writer.writer);
Expand Down
4 changes: 2 additions & 2 deletions bindings/go/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ var withBytesFree = withFFI(ffiOpts{
rType: &ffi.TypeVoid,
aTypes: []*ffi.Type{&typeBytes},
}, func(_ context.Context, ffiCall func(rValue unsafe.Pointer, aValues ...unsafe.Pointer)) bytesFree {
return func(b opendalBytes) {
return func(b *opendalBytes) {
ffiCall(
nil,
b,
unsafe.Pointer(&b),
)
}
})

0 comments on commit 9ac2373

Please sign in to comment.