Skip to content

Commit

Permalink
Update variable in catch_assert file to allow uncrustify-ing (FreeRTO…
Browse files Browse the repository at this point in the history
…S#419)

* Update variable names to please uncrustify

* Update the uncrustify script too
  • Loading branch information
AniruddhaKanhere authored Feb 4, 2022
1 parent a067dff commit 8678034
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Run Uncrustify
run: |
uncrustify --version
find . -not -path '.*catch_assert.h' -iname "*.[hc]" -exec uncrustify --check -c tools/uncrustify.cfg {} +
find . -iname "*.[hc]" -exec uncrustify --check -c tools/uncrustify.cfg {} +
if [ "$?" = "0" ]; then
exit 0
else
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/uncrustify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- name: Run Uncrustify
run: |
uncrustify --version
find . -not -path '.*catch_assert.h' -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} +
find . -not -path '.*catch_assert.h' -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} +
find . -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} +
find . -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} +
- name: Push changes to upstream repository
run: |
git config --global user.name 'GitHub Action'
Expand Down
8 changes: 4 additions & 4 deletions test/unit-test/catch_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ static void catchHandler_( int signal )

#define catch_assert( x ) \
do { \
int try = 0, catch = 0; \
int ltry = 0, lcatch = 0; \
int saveFd = dup( 2 ); \
struct sigaction sa = { 0 }, saveSa; \
sa.sa_handler = catchHandler_; \
sigaction( SIGABRT, &sa, &saveSa ); \
close( 2 ); \
if( setjmp( CATCH_JMPBUF ) == 0 ) \
{ \
try++; \
ltry++; \
x; \
} \
else \
{ \
catch++; \
lcatch++; \
} \
sigaction( SIGABRT, &saveSa, NULL ); \
dup2( saveFd, 2 ); \
close( saveFd ); \
TEST_ASSERT_EQUAL( try, catch ); \
TEST_ASSERT_EQUAL( ltry, lcatch ); \
} while( 0 )

#endif /* ifndef CATCH_ASSERT_H_ */

0 comments on commit 8678034

Please sign in to comment.