Skip to content

Commit

Permalink
Merge b2f7f65 into ca75c01
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Jun 24, 2018
2 parents ca75c01 + b2f7f65 commit e17d762
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 282 deletions.
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2

workflows:
version: 2
build_linux:
jobs:
- x86_64

jobs:
x86_64:
working_directory: ~/work
docker:
- image: circleci/builder-base:latest

steps:
- checkout
- run: add-apt-repository ppa:chris-lea/libsodium
- run: apt update
- run: apt install -y clang cmake libgtest-dev libopus-dev libsodium-dev libvpx-dev pkg-config
- run: cmake -H. -B_build -DDEBUG=ON -DTRACE=ON -DERROR_ON_WARNING=ON -DASAN=ON -DMUST_BUILD_TOXAV=ON -DSTRICT_ABI=ON -DTEST_TIMEOUT_SECONDS=90 -DUSE_IPV6=OFF
- run: make -C _build -j$(nproc)
- run: make -C _build test ARGS="-j50 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1 || make -C _build test ARGS="-j50 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ if(NOT MSVC)
add_cxxflag("-Wno-old-style-cast")

# Downgrade to warning so we still see it.
add_flag("-Wno-error=unreachable-code")
add_flag("-Wno-error=unused-variable")
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion auto_tests/TCP_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static inline IP get_loopback()
return ip;
}

static uint16_t ports[NUM_PORTS] = {1234, 33445, 25643};
static uint16_t ports[NUM_PORTS] = {13215, 33445, 25643};

START_TEST(test_basic)
{
Expand Down
2 changes: 2 additions & 0 deletions auto_tests/messenger_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ int main(void)
/* IPv6 status from global define */
Messenger_Options options = {0};
options.ipv6enabled = TOX_ENABLE_IPV6_DEFAULT;
options.port_range[0] = 41234;
options.port_range[1] = 44234;
options.log_callback = (logger_cb *)print_debug_log;
m = new_messenger(&options, nullptr);

Expand Down
3 changes: 2 additions & 1 deletion auto_tests/network_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ START_TEST(test_addr_resolv_localhost)
extra.family.value);
ck_assert_msg(extra.ip.v4.uint32 == loopback, "Expected 127.0.0.1, got %s.",
ip_ntoa(&ip, ip_str, sizeof(ip_str)));
#else
#elif 0
// TODO(iphydf): Fix this to work on IPv6-supporting systems.
ck_assert_msg(net_family_is_ipv4(ip.family), "Expected family TOX_AF_INET (%d), got %u.", TOX_AF_INET, ip.family.value);
ck_assert_msg(ip.ip.v4.uint32 == loopback, "Expected 127.0.0.1, got %s.",
ip_ntoa(&ip, ip_str, sizeof(ip_str)));
Expand Down
8 changes: 4 additions & 4 deletions auto_tests/onion_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ START_TEST(test_basic)
logger_callback_log(log2, (logger_cb *)print_debug_log, nullptr, &index[1]);

IP ip = get_loopback();
Onion *onion1 = new_onion(new_DHT(log1, new_networking(log1, ip, 34567), true));
Onion *onion2 = new_onion(new_DHT(log2, new_networking(log2, ip, 34568), true));
Onion *onion1 = new_onion(new_DHT(log1, new_networking(log1, ip, 36567), true));
Onion *onion2 = new_onion(new_DHT(log2, new_networking(log2, ip, 36568), true));
ck_assert_msg((onion1 != nullptr) && (onion2 != nullptr), "Onion failed initializing.");
networking_registerhandler(onion2->net, NET_PACKET_ANNOUNCE_REQUEST, &handle_test_1, onion2);

Expand Down Expand Up @@ -256,7 +256,7 @@ START_TEST(test_basic)
Logger *log3 = logger_new();
logger_callback_log(log3, (logger_cb *)print_debug_log, nullptr, &index[2]);

Onion *onion3 = new_onion(new_DHT(log3, new_networking(log3, ip, 34569), true));
Onion *onion3 = new_onion(new_DHT(log3, new_networking(log3, ip, 36569), true));
ck_assert_msg((onion3 != nullptr), "Onion failed initializing.");

random_nonce(nonce);
Expand Down Expand Up @@ -478,7 +478,7 @@ START_TEST(test_announce)

for (i = 0; i < NUM_ONIONS; ++i) {
index[i] = i + 1;
onions[i] = new_onions(i + 34655, &index[i]);
onions[i] = new_onions(i + 36655, &index[i]);
ck_assert_msg(onions[i] != nullptr, "Failed to create onions. %u", i);
}

Expand Down
148 changes: 0 additions & 148 deletions circle.yml

This file was deleted.

0 comments on commit e17d762

Please sign in to comment.