Skip to content

Commit

Permalink
chore: Fix gen-file.sh: it wasn't globbing properly.
Browse files Browse the repository at this point in the history
Also fix crypto_core_test.cc to comply with the stack frame limit.
  • Loading branch information
iphydf committed Dec 14, 2021
1 parent cd83c92 commit ebea3ab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
cppcheck
g++
libconfig-dev
libgtest-dev
libopus-dev
libsodium-dev
libvpx-dev
Expand Down
5 changes: 3 additions & 2 deletions other/analysis/gen-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CPPFLAGS+=("-Itoxcore")
CPPFLAGS+=("-Itoxav")
CPPFLAGS+=("-Itoxencryptsave")

LDFLAGS=("-lopus" "-lsodium" "-lvpx" "-lpthread" "-lconfig")
LDFLAGS=("-lopus" "-lsodium" "-lvpx" "-lpthread" "-lconfig" "-lgtest")
LDFLAGS+=("-fuse-ld=gold")
LDFLAGS+=("-Wl,--detect-odr-violations")
LDFLAGS+=("-Wl,--warn-common")
Expand Down Expand Up @@ -44,12 +44,13 @@ callmain() {

put auto_tests/check_compat.h

FIND_QUERY="find . '-(' -name '*.c' -or -name "*.cc" '-)'"
FIND_QUERY="find . '-(' -name '*.c' -or -name '*.cc' '-)'"
FIND_QUERY="$FIND_QUERY -and -not -wholename './_build/*'"
FIND_QUERY="$FIND_QUERY -and -not -wholename './super_donators/*'"
FIND_QUERY="$FIND_QUERY -and -not -name amalgamation.cc"
FIND_QUERY="$FIND_QUERY -and -not -name av_test.c"
FIND_QUERY="$FIND_QUERY -and -not -name dht_test.c"
FIND_QUERY="$FIND_QUERY -and -not -name trace.cc"
FIND_QUERY="$FIND_QUERY -and -not -name version_test.c"

readarray -t FILES <<<"$(eval "$FIND_QUERY")"
Expand Down
1 change: 1 addition & 0 deletions other/analysis/run-clang
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ clang++ -o /dev/null amalgamation.cc \
-Wno-covered-switch-default \
-Wno-disabled-macro-expansion \
-Wno-documentation-deprecated-sync \
-Wno-global-constructors \
-Wno-missing-field-initializers \
-Wno-old-style-cast \
-Wno-padded \
Expand Down
6 changes: 3 additions & 3 deletions toxcore/crypto_core_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ std::pair<clock_t, clock_t> memcmp_median(uint8_t const *src, uint8_t const *sam
*/
TEST(CryptoCore, MemcmpTimingIsDataIndependent) {
// A random piece of memory.
std::array<uint8_t, CRYPTO_TEST_MEMCMP_SIZE> src;
std::vector<uint8_t> src(CRYPTO_TEST_MEMCMP_SIZE);
random_bytes(src.data(), CRYPTO_TEST_MEMCMP_SIZE);

// A separate piece of memory containing the same data.
std::array<uint8_t, CRYPTO_TEST_MEMCMP_SIZE> same = src;
std::vector<uint8_t> same = src;

// Another piece of memory containing different data.
std::array<uint8_t, CRYPTO_TEST_MEMCMP_SIZE> not_same;
std::vector<uint8_t> not_same(CRYPTO_TEST_MEMCMP_SIZE);
random_bytes(not_same.data(), CRYPTO_TEST_MEMCMP_SIZE);

// Once we have C++17:
Expand Down

0 comments on commit ebea3ab

Please sign in to comment.