Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5389910
[C#] Generate DTOs from SBE IR for non-perf-sensitive usecases.
ZachBray Sep 27, 2023
68af4f6
[Java] Start to introduce property based testing (PBT).
ZachBray Oct 5, 2023
439ee4b
[Java] Fix typos.
ZachBray Oct 5, 2023
b94ef12
[Java] Move property tests to their own source set.
ZachBray Oct 5, 2023
ea7e84b
[Java] Suppress javadoc warnings in propertyTest source set.
ZachBray Oct 6, 2023
526eac2
[Java] Split apart schema generation files.
ZachBray Oct 6, 2023
0a2a6e4
[Java] Extend PBT to generate arbitrary encoded messages.
ZachBray Oct 6, 2023
5af0274
[Java] Test DTOs preserve information.
ZachBray Oct 7, 2023
fdf7742
[Java,C#] Make dotnet executable customisable in tests.
ZachBray Oct 10, 2023
852a0fe
[Java] Extend schema generation to include bitsets with gaps.
ZachBray Oct 10, 2023
92588c0
[Java] Use arbitrary fixed-length arrays in property tests.
ZachBray Oct 10, 2023
b205c4b
[Java] Model optional fields in property-based tests.
ZachBray Oct 11, 2023
58b0e92
[Java, C#] Add a GitHub workflow for slow checks.
ZachBray Oct 11, 2023
4f9d51b
[Java] Extend arbitrary varData encodings.
ZachBray Oct 11, 2023
77711dd
[Java, C#] Tidy up encoded message writing in tests.
ZachBray Oct 12, 2023
19f69a9
[C#] Upgrade to latest LTS .NET version.
ZachBray Oct 12, 2023
520cdb1
[C#] Generate DTOs using C# 9+ records.
ZachBray Oct 12, 2023
c1afd03
[C#] Use more-idiomatic null representations.
ZachBray Oct 17, 2023
207ab1f
[IR] Change default float and double values to minimum representable …
ZachBray Oct 18, 2023
4201789
[C#] Add validation to DTOs and improve use of records.
ZachBray Oct 18, 2023
bc17a46
[C#] Support DTO generation via system property.
ZachBray Oct 18, 2023
248eae9
[C#] Extend tests to cover extended schemas.
ZachBray Oct 19, 2023
7ee9265
[C#] Address some of Martin's feedback re "added" var data representa…
ZachBray Nov 9, 2023
1b98e1d
[C#] Address feedback around encode/decode methods.
ZachBray Nov 10, 2023
96b7032
[C++] Generate DTOs for non-perf-sensitive usecases.
ZachBray Nov 2, 2023
029fb25
[C++] Only build DTOs with compilers that support C++ 17.
ZachBray Nov 2, 2023
246e6f7
[C++] Improve naming conventions in DTOs.
ZachBray Nov 3, 2023
e33c6a8
[C++] Support "to string" without specification of buffer length.
ZachBray Nov 3, 2023
f88d345
[C++] Fix issues with length computation.
ZachBray Nov 3, 2023
f965d2a
[C++] Address feedback from Todd re var data representation.
ZachBray Nov 9, 2023
21cde2a
[C++] Add PBT for C++ DTOs.
ZachBray Nov 11, 2023
a0fc525
[Java, C++, C#] Ensure buffer is large enough to contain message.
ZachBray Nov 13, 2023
2195d6e
[CI] Fix dependency conflict in JQwik.
ZachBray Nov 11, 2023
b9ed08b
[CI] Upload slow test artifacts upon failure.
ZachBray Nov 13, 2023
b27bb68
[C#] Provide path to SBE.dll for C# property tests in CI.
ZachBray Nov 13, 2023
1e3cf8f
[Java] Adjust copyright banners.
ZachBray May 1, 2024
328cc42
[Java] Add support for DTO generation.
ZachBray May 13, 2024
41f4b0e
[Java] Extend property-based tests to exercise Java DTOs.
ZachBray May 14, 2024
75df462
[Java] Avoid checking parentMessage.actingVersion inside composite.
ZachBray May 15, 2024
60bd119
[Java] Fix remaining DTO issues uncovered with PBT.
ZachBray May 15, 2024
6e0234b
[Java] Tidy up spacing.
ZachBray May 15, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[C++] Address feedback from Todd re var data representation.
It is more-idiomatic to represent variable-length data using `std::string` even when there is no character encoding specified, the the `std::string` API provides useful utilities regardless.
  • Loading branch information
ZachBray committed Jun 25, 2024
commit f965d2a7e649d8b2b4646e54e8ccd032accc0057
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,6 @@ private void generateVarDataDecodeWith(
if (token.signal() == Signal.BEGIN_VAR_DATA)
{
final String propertyName = token.name();
final Token varDataToken = Generators.findFirst("varData", tokens, i);
final String characterEncoding = varDataToken.encoding().characterEncoding();
final String formattedPropertyName = formatPropertyName(propertyName);

final boolean isOptional = token.version() > 0;
Expand All @@ -739,19 +737,8 @@ private void generateVarDataDecodeWith(
.append(blockIndent).append("const char* ").append(dataVar)
.append(" = codec.").append(formattedPropertyName).append("();\n");

final String dtoValue;
final String nullDtoValue;

if (characterEncoding == null)
{
dtoValue = "std::vector<std::uint8_t>(" + dataVar + ", " + dataVar + " + " + lengthVar + ")";
nullDtoValue = "std::vector<std::uint8_t>()";
}
else
{
dtoValue = "std::string(" + dataVar + ", " + lengthVar + ")";
nullDtoValue = "\"\"";
}
final String dtoValue = "std::string(" + dataVar + ", " + lengthVar + ")";
final String nullDtoValue = "\"\"";

if (isOptional)
{
Expand Down Expand Up @@ -1129,29 +1116,13 @@ private void generateVarDataEncodeWith(
if (token.signal() == Signal.BEGIN_VAR_DATA)
{
final String propertyName = token.name();
final Token lengthToken = Generators.findFirst("length", tokens, i);
final String lengthTypeName = cppTypeName(lengthToken.encoding().primitiveType());
final Token varDataToken = Generators.findFirst("varData", tokens, i);
final String characterEncoding = varDataToken.encoding().characterEncoding();
final String formattedPropertyName = formatPropertyName(propertyName);
final String varName = toLowerFirstChar(propertyName) + "Vector";

sb.append(indent).append("auto& ").append(varName).append(" = dto.")
.append(formattedPropertyName).append("();\n")
.append(indent).append("codec.put").append(toUpperFirstChar(propertyName))
.append("(");

if (null == characterEncoding)
{
sb.append("reinterpret_cast<const char*>(").append(varName).append(".data()), ")
.append("static_cast<").append(lengthTypeName).append(">(").append(varName).append(".size())");
}
else
{
sb.append(varName);
}

sb.append(");\n");
.append("(").append(varName).append(");\n");
}
}
}
Expand Down Expand Up @@ -1629,9 +1600,7 @@ private void generateVarData(
if (token.signal() == Signal.BEGIN_VAR_DATA)
{
final String propertyName = token.name();
final Token varDataToken = Generators.findFirst("varData", tokens, i);
final String characterEncoding = varDataToken.encoding().characterEncoding();
final String dtoType = characterEncoding == null ? "std::vector<std::uint8_t>" : "std::string";
final String dtoType = "std::string";

final String fieldName = "m_" + toLowerFirstChar(propertyName);
final String formattedPropertyName = formatPropertyName(propertyName);
Expand Down