tests: runtime: Handle byte order mark for non-ASCII environment of Windows correctly#12100
tests: runtime: Handle byte order mark for non-ASCII environment of Windows correctly#12100cosmo0920 wants to merge 2 commits into
Conversation
…f Windows Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
📝 WalkthroughWalkthroughRuntime tests now add a UTF-8 BOM prefix to one source comment and represent BOM bytes explicitly in RFC5424 syslog expected strings using a shared macro. ChangesUTF-8 BOM test updates
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/runtime/out_syslog.c`:
- Line 1453: Split the oversized RFC5424 expected string literals near the
affected assertions into adjacent C string literals on multiple lines, including
the occurrences around the referenced expectations. Preserve exact compile-time
concatenation and expected values while keeping each source line within the
project’s 120-character limit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f8237e25-052b-4367-bcc1-461a9418f430
📒 Files selected for processing (1)
tests/runtime/out_syslog.c
|
|
||
| char *expected_strs[] = {"hello world", "1970-01-01T00:00:01.000000Z", | ||
| "<14>1 1970-01-01T00:00:01.000000Z - - - - [sd_key logtype=\"access\" clustername=\"mycluster\" namespace=\"mynamespace\"] hello world"}; | ||
| "<14>1 1970-01-01T00:00:01.000000Z - - - - [sd_key logtype=\"access\" clustername=\"mycluster\" namespace=\"mynamespace\"] " UTF8_BOM "hello world"}; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Split the oversized expected strings.
These RFC5424 expectations exceed 120 characters. Split them into adjacent C string literals across multiple lines; compile-time concatenation preserves the exact expected value while following the project’s line-length guideline.
As per coding guidelines, C/C++ lines should target 100 characters and avoid exceeding 120 where avoidable.
Also applies to: 1509-1509, 1566-1566
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/runtime/out_syslog.c` at line 1453, Split the oversized RFC5424
expected string literals near the affected assertions into adjacent C string
literals on multiple lines, including the occurrences around the referenced
expectations. Preserve exact compile-time concatenation and expected values
while keeping each source line within the project’s 120-character limit.
Source: Coding guidelines
Especially, cp932 Windows causes compilation failure without appropriate BOM handlings on in_tail and out_syslog runtime tests.
Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit
Bug Fixes
Tests