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

Expose nb bytes read, add actions #10

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci-tests-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: "CITestsClang"

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
citests:
name: CI-Tests-Clang
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'

- name: Run cmake
run: |
sudo apt-get install clangd
echo $CC
echo $CXX
$CC --version
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
CFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
cmake .
make -j 4

- name: Perform Unit Tests
run: |
./cdnstest
35 changes: 35 additions & 0 deletions .github/workflows/ci-tests-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: "CITestsMacOS"

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
citests:
name: CI-Tests-MacOS
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'

- name: Run cmake
run: |
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror"
CFLAGS="-Wall -Wextra -Wpedantic -Werror"
cmake .
make -j 4

- name: Perform Unit Tests
run: |
./cdnstest
41 changes: 41 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: "CITests"

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
citests:
name: CI-Tests
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'

- name: Run cmake
run: |
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
CFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
cmake .
make -j 4

- name: Perform Unit Tests
run: |
./cdnstest

- name: Run Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind
valgrind -v --error-exitcode=1 --track-origins=yes ./cdnstest
Binary file added .vs/cmake.db
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/cdns.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ class cdns
int index_offset;
uint8_t* buf;
size_t buf_size;
size_t buf_read;

private:
size_t buf_read;
size_t buf_parsed;
bool end_of_file;
bool preamble_parsed;
Expand Down
Loading