Skip to content

Conversation

@JFreegman
Copy link
Member

@JFreegman JFreegman commented May 6, 2020

Fixed a small bug in group_message_test as well


This change is Reviewable

@JFreegman JFreegman added this to the groupchats milestone May 6, 2020
@JFreegman JFreegman requested a review from iphydf May 6, 2020 07:00
@JFreegman JFreegman changed the title feature:Add autotest for group moderation test: Add autotest for group moderation May 6, 2020
@auto-add-label auto-add-label bot added the test Adding missing tests, refactoring tests; no production code change label May 6, 2020
@codecov
Copy link

codecov bot commented May 6, 2020

Codecov Report

Merging #1519 into ngc will increase coverage by 2.36%.
The diff coverage is 95.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##              ngc    #1519      +/-   ##
==========================================
+ Coverage   79.30%   81.67%   +2.36%     
==========================================
  Files          94       95       +1     
  Lines       20223    20366     +143     
==========================================
+ Hits        16038    16634     +596     
+ Misses       4185     3732     -453     
Impacted Files Coverage Δ
auto_tests/group_announce_test.c 90.24% <50.00%> (+5.46%) ⬆️
auto_tests/group_moderation_test.c 95.80% <95.80%> (ø)
auto_tests/group_message_test.c 93.33% <100.00%> (ø)
auto_tests/groupchat_test.c 98.26% <100.00%> (+0.07%) ⬆️
toxcore/net_crypto.c 94.41% <0.00%> (ø)
toxcore/Messenger.c 86.22% <0.00%> (+0.14%) ⬆️
toxcore/onion_client.c 96.56% <0.00%> (+0.14%) ⬆️
toxcore/DHT.c 77.50% <0.00%> (+0.18%) ⬆️
toxcore/tox.c 57.88% <0.00%> (+1.23%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eac365c...448cf3f. Read the comment docs.


printf("%s sent message to %s: %s\n", peer_name, self_name, message_buf);
ck_assert(memcmp(message_buf, TEST_MESSAGE, length) == 0);
ck_assert(!memcmp(message_buf, TEST_MESSAGE, length));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer == 0, because int is not an Essentially Boolean type (MISRA C:2012 8.10.2). I know !memcmp and !strcmp is a common idiom in C, but prefer strong typing over poor (even if common) idioms.

Fixed a couple issues in the other group tests as well
@JFreegman JFreegman merged commit 448cf3f into TokTok:ngc May 6, 2020
@JFreegman JFreegman deleted the ngc_mod_test branch May 7, 2020 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Adding missing tests, refactoring tests; no production code change

Development

Successfully merging this pull request may close these issues.

2 participants