Skip to content

Commit 7a0e602

Browse files
authored
include at least one DEBUG build on CI (+fix two asserts which had unnoticed errors) (#190)
1 parent c117d01 commit 7a0e602

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/tests+artifacts+pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ on:
1515
types: [published]
1616

1717
jobs:
18-
todos_annotated:
18+
todos_annotated_and_debug_build_ok:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v2
2222
with:
2323
submodules: recursive
2424
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
2525
- run: pip install -r test-time-requirements.txt
26-
- run: DEBUG=0 VERBOSE=1 pip install --verbose -e .
26+
- run: DEBUG=1 VERBOSE=1 pip install --verbose -e .
2727
- env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
run: pytest -v -s -We -p no:unraisableexception tests/test_todos_annotated.py
3030

3131
build:
32-
needs: [todos_annotated]
32+
needs: [todos_annotated_and_debug_build_ok]
3333
strategy:
3434
matrix:
3535
platform: [ubuntu-latest, macos-12, windows-latest]

src/fake_spec_file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void c_spec_file_read_line(
219219

220220
int i = 0;
221221
for (const auto &ch : name) {
222-
assert(i < name_size);
222+
assert(i < *name_size);
223223
name_data[i++] = ch;
224224
}
225225
*name_size = i;

src/gimmicks.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ struct Gimmick {
102102
return this->json->empty();
103103
}
104104

105+
auto size() noexcept {
106+
return this->json->size();
107+
}
108+
105109
std::size_t n_elements(const bpstd::string_view &name) noexcept {
106110
for (auto i=0u; i<this->json->size(); ++i) {
107111
for (auto &entry : this->json->at(i).items()) {
@@ -227,7 +231,7 @@ struct InputGimmick: Gimmick {
227231
}
228232

229233
if (!eof) {
230-
assert(this>size() == 1);
234+
assert(this->size() == 1);
231235
auto key = this->last_dict_key();
232236
if (this->key_name != "" && (this->key_cond == this->last_read_line_key)) {
233237
name = this->key_name;

0 commit comments

Comments
 (0)