Skip to content

Commit 5eea536

Browse files
authored
Merge pull request #10 from private-octopus/expose-buffer-for-tests
Expose nb bytes read, add actions
2 parents db09a80 + 7b662db commit 5eea536

File tree

5 files changed

+119
-1
lines changed

5 files changed

+119
-1
lines changed

.github/workflows/ci-tests-clang.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: "CITestsClang"
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
citests:
14+
name: CI-Tests-Clang
15+
runs-on: ubuntu-latest
16+
env:
17+
CC: clang
18+
CXX: clang++
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v2
23+
with:
24+
# We must fetch at least the immediate parents so that if this is
25+
# a pull request then we can checkout the head.
26+
fetch-depth: 2
27+
submodules: 'recursive'
28+
29+
- name: Run cmake
30+
run: |
31+
sudo apt-get install clangd
32+
echo $CC
33+
echo $CXX
34+
$CC --version
35+
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
36+
CFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
37+
cmake .
38+
make -j 4
39+
40+
- name: Perform Unit Tests
41+
run: |
42+
./cdnstest

.github/workflows/ci-tests-macos.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: "CITestsMacOS"
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
citests:
14+
name: CI-Tests-MacOS
15+
runs-on: macos-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
with:
21+
# We must fetch at least the immediate parents so that if this is
22+
# a pull request then we can checkout the head.
23+
fetch-depth: 2
24+
submodules: 'recursive'
25+
26+
- name: Run cmake
27+
run: |
28+
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror"
29+
CFLAGS="-Wall -Wextra -Wpedantic -Werror"
30+
cmake .
31+
make -j 4
32+
33+
- name: Perform Unit Tests
34+
run: |
35+
./cdnstest

.github/workflows/ci-tests.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: "CITests"
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
citests:
14+
name: CI-Tests
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
with:
21+
# We must fetch at least the immediate parents so that if this is
22+
# a pull request then we can checkout the head.
23+
fetch-depth: 2
24+
submodules: 'recursive'
25+
26+
- name: Run cmake
27+
run: |
28+
CXXFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
29+
CFLAGS="-Wall -Wextra -Wpedantic -Werror -g"
30+
cmake .
31+
make -j 4
32+
33+
- name: Perform Unit Tests
34+
run: |
35+
./cdnstest
36+
37+
- name: Run Valgrind
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y valgrind
41+
valgrind -v --error-exitcode=1 --track-origins=yes ./cdnstest

.vs/cmake.db

36 KB
Binary file not shown.

lib/cdns.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,9 @@ class cdns
522522
int index_offset;
523523
uint8_t* buf;
524524
size_t buf_size;
525+
size_t buf_read;
525526

526527
private:
527-
size_t buf_read;
528528
size_t buf_parsed;
529529
bool end_of_file;
530530
bool preamble_parsed;

0 commit comments

Comments
 (0)