Address code review feedback: fix assertion order and workflow issues

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-28 18:08:00 +00:00
parent f4448d8881
commit c781121dbc
4 changed files with 6 additions and 13 deletions

View File

@@ -25,7 +25,6 @@ jobs:
ovmf \
mtools \
xorriso \
scrot \
imagemagick
- name: Build bootloader

View File

@@ -33,10 +33,4 @@ jobs:
- name: Test summary
if: always()
run: |
echo "Unit tests completed"
if [ $? -eq 0 ]; then
echo "✓ All tests passed"
else
echo "✗ Some tests failed"
exit 1
fi
echo "Unit test execution completed"

View File

@@ -50,7 +50,7 @@ static TestStats test_stats = {0, 0, 0};
do { \
if ((a) != (b)) { \
printf(COLOR_RED "[FAILED] " COLOR_RESET "%s:%d: Expected %lld, got %lld\n", \
__FILE__, __LINE__, (long long)(a), (long long)(b)); \
__FILE__, __LINE__, (long long)(b), (long long)(a)); \
test_stats.failed++; \
return; \
} \
@@ -59,8 +59,8 @@ static TestStats test_stats = {0, 0, 0};
#define ASSERT_NE(a, b) \
do { \
if ((a) == (b)) { \
printf(COLOR_RED "[FAILED] " COLOR_RESET "%s:%d: Expected not equal: %lld == %lld\n", \
__FILE__, __LINE__, (long long)(a), (long long)(b)); \
printf(COLOR_RED "[FAILED] " COLOR_RESET "%s:%d: Values should not be equal: %lld\n", \
__FILE__, __LINE__, (long long)(a)); \
test_stats.failed++; \
return; \
} \

View File

@@ -19,8 +19,8 @@ typedef struct {
uint32_t bg_color;
} Console;
// Mock framebuffer for testing
static uint32_t test_framebuffer[1920 * 1080];
// Mock framebuffer for testing (using smaller size to avoid stack issues)
static uint32_t test_framebuffer[800 * 600];
// Simplified console functions for unit testing
// In real implementation, these would be in a testable module