Skip to content

Commit

Permalink
fix go cases
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Oct 8, 2024
1 parent 0b5e86f commit 32dba0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 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
2 changes: 1 addition & 1 deletion bindings/c/tests/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TEST_F(OpendalListTest, ListDirTest)
};

// write must succeed
EXPECT_EQ(opendal_operator_write(this->p, path.c_str(), data),
EXPECT_EQ(opendal_operator_write(this->p, path.c_str(), &data),
nullptr);

// list must succeed since the write succeeded
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 32dba0c

Please sign in to comment.