Skip to content

Commit 285b4cf

Browse files
committed
Only clang-format-20 on ubuntu 24
1 parent 05528ce commit 285b4cf

File tree

4 files changed

+60
-190
lines changed

4 files changed

+60
-190
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
libzmq: "4.3.5"
4545
libzmqbuild: "cmake"
4646
coverage: "-DCOVERAGE=ON"
47-
aptinstall: "lcov clang-format"
47+
aptinstall: "lcov"
4848
# clang
4949
- os: "ubuntu-22.04"
5050
cppstd: "17"
@@ -61,7 +61,7 @@ jobs:
6161
drafts: "OFF"
6262
libzmq: "4.3.5"
6363
libzmqbuild: false
64-
brewinstall: "zeromq clang-format"
64+
brewinstall: "zeromq"
6565
# windows
6666
#- os: "windows-2019"
6767
# cppstd: "14"
@@ -133,10 +133,11 @@ jobs:
133133
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
134134
135135
- name: format
136-
if: ${{ startsWith(matrix.os, 'ubuntu') }}
136+
if: ${{ startsWith(matrix.os, 'ubuntu-24') }}
137137
run: |
138-
clang-format --version
139-
git ls-files | grep -E '\.(cpp|hpp)' | xargs clang-format --dry-run --Werror
138+
sudo apt install -y clang-format-20
139+
clang-format-20 --version
140+
git ls-files | grep -E '\.(cpp|hpp)' | xargs clang-format-20 --dry-run --Werror
140141
141142
- name: build
142143
env:

tests/timers.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ TEST_CASE("timers add/execute", "[timers]")
2222
using namespace std::chrono_literals;
2323
zmq::timers timers;
2424
bool handler_ran = false;
25-
timers.add(
26-
4ms, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
25+
timers.add(4ms, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
2726
CHECK(timers.timeout().has_value());
2827
CHECK(!handler_ran);
2928
std::this_thread::sleep_for(10ms);
@@ -36,8 +35,8 @@ TEST_CASE("timers add/cancel", "[timers]")
3635
using namespace std::chrono_literals;
3736
zmq::timers timers;
3837
bool handler_ran = false;
39-
auto id = timers.add(
40-
4ms, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
38+
auto id =
39+
timers.add(4ms, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
4140
CHECK(timers.timeout().has_value());
4241
CHECK(!handler_ran);
4342
timers.cancel(id);
@@ -51,8 +50,8 @@ TEST_CASE("timers set_interval", "[timers]")
5150
zmq::timers timers;
5251
bool handler_ran = false;
5352
// Interval of 4 hours should never run like this
54-
auto id = timers.add(
55-
4h, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
53+
auto id =
54+
timers.add(4h, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
5655
CHECK(timers.timeout().has_value());
5756
CHECK(!handler_ran);
5857
// Change the interval to 4ms and wait for it to timeout
@@ -67,8 +66,8 @@ TEST_CASE("timers reset", "[timers]")
6766
using namespace std::chrono_literals;
6867
zmq::timers timers;
6968
bool handler_ran = false;
70-
auto id = timers.add(
71-
4ms, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
69+
auto id =
70+
timers.add(4ms, [](auto, void *arg) { *(bool *) arg = true; }, &handler_ran);
7271
CHECK(timers.timeout().has_value());
7372
std::this_thread::sleep_for(10ms);
7473
// Available to be executed but we reset it

0 commit comments

Comments
 (0)