Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add c, cpp examples #1485

Merged
merged 1 commit into from
Apr 23, 2023
Merged

Add c, cpp examples #1485

merged 1 commit into from
Apr 23, 2023

Conversation

andyfengHKU
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Apr 23, 2023

Codecov Report

Patch coverage: 36.84% and project coverage change: -0.06 ⚠️

Comparison is base (8dc87ca) 92.12% compared to head (1217959) 92.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1485      +/-   ##
==========================================
- Coverage   92.12%   92.07%   -0.06%     
==========================================
  Files         671      671              
  Lines       23831    23846      +15     
==========================================
+ Hits        21955    21956       +1     
- Misses       1876     1890      +14     
Impacted Files Coverage Δ
src/c_api/query_result.cpp 92.15% <0.00%> (-7.85%) ⬇️
src/include/main/query_result.h 100.00% <ø> (ø)
src/include/processor/result/flat_tuple.h 100.00% <ø> (ø)
src/main/query_result.cpp 77.48% <0.00%> (-4.34%) ⬇️
src/c_api/flat_tuple.cpp 100.00% <100.00%> (ø)
src/processor/result/flat_tuple.cpp 90.90% <100.00%> (-5.52%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

examples/c/main.c Outdated Show resolved Hide resolved
@@ -54,8 +54,8 @@ TEST_F(CApiFlatTupleTest, ToString) {
columnWidths[0] = 10;
columnWidths[1] = 5;
columnWidths[2] = 10;
auto str = kuzu_flat_tuple_to_string(flatTuple, columnWidths, 3, "\t", 1024);
ASSERT_EQ(std::string(str), " Alice \t 35 \t 1.731000 ");
auto str = kuzu_flat_tuple_to_string(flatTuple);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the function no longer requires passing a columnWidths array. It should also be removed from this test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is meant to replace the original to_string API with a new one that doesn't require columnWidths. to_string() is still needed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that the lines:

    auto columnWidths = (uint32_t*)malloc(3 * sizeof(uint32_t));
    columnWidths[0] = 10;
    columnWidths[1] = 5;
    columnWidths[2] = 10;

and

    free(columnWidths);

should be removed as the function is no longer called with columnWidths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants