Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
temp commit to debug CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hhenry01 committed Mar 7, 2024
1 parent 253526e commit 9d4baef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ function(make_unit_test module srcs link_libs inc_dirs compile_defs)
add_dependencies(${test_module} ${AUTOGEN_TARGETS})
# Make the unit test runnable with CTest (invoked via test.sh)
add_test(NAME ${test_module} COMMAND ${test_module})
set_tests_properties(${test_module} PROPERTIES TIMEOUT 60) # 1 minute per test timeout
endif()
endfunction()
6 changes: 3 additions & 3 deletions projects/local_transceiver/src/local_transceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ void LocalTransceiver::updateSensor(msg::GenericSensors msg)
void LocalTransceiver::updateSensor(msg::LPathData localData)
{
sensors_.clear_local_path_data();
Sensors::Path * new_local = sensors_.mutable_local_path_data();
for (const msg::HelperLatLon & local_data : localData.local_path.waypoints) {
Sensors::Path * new_local = sensors_.mutable_local_path_data();
Polaris::Waypoint * waypoint = new_local->add_waypoints();
Polaris::Waypoint * waypoint = new_local->add_waypoints();
waypoint->set_latitude(local_data.latitude);
waypoint->set_longitude(local_data.longitude);
}
Expand Down Expand Up @@ -135,7 +135,7 @@ bool LocalTransceiver::send()
throw std::length_error(err_string);
}

std::string write_bin_cmd_str = AT::write_bin::CMD + std::to_string(data.size()); //according to specs
std::string write_bin_cmd_str = AT::write_bin::CMD + std::to_string(data.size()); //according to specs
AT::Line at_write_cmd(write_bin_cmd_str);

static constexpr int MAX_NUM_RETRIES = 20; // allow retries because the connection is imperfect
Expand Down
22 changes: 17 additions & 5 deletions projects/local_transceiver/test/test_local_transceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,25 @@ class TestLocalTransceiver : public ::testing::Test
protected:
static void SetUpTestSuite() { http_echo_server_proc_ = bp::child(RUN_HTTP_ECHO_SERVER_CMD); }

static void TearDownTestSuite() { http_echo_server_proc_.terminate(); }
static void TearDownTestSuite()
{
std::error_code e;
http_echo_server_proc_.terminate(e);
if (e) {
throw std::runtime_error("Failed to terminate HTTP Echo Server! " + e.message());
}
}

TestLocalTransceiver()
{
try {
lcl_trns_ = new LocalTransceiver(LOCAL_TRANSCEIVER_TEST_PORT, SATELLITE_BAUD_RATE);
} catch (boost::system::system_error & /**/) {
std::cerr << "Failed to create Local Transceiver for tests, is only one instance of: \""
<< RUN_VIRTUAL_IRIDIUM_SCRIPT_PATH << "\" running?" << std::endl;
} catch (boost::system::system_error & e) {
std::stringstream ss;
ss << "Failed to create Local Transceiver for tests, is only one instance of: \""
<< RUN_VIRTUAL_IRIDIUM_SCRIPT_PATH << "\" running?" << std::endl;
ss << e.what() << std::endl;
throw std::runtime_error(ss.str());
}
}
~TestLocalTransceiver() override
Expand Down Expand Up @@ -162,5 +172,7 @@ TEST_F(TestLocalTransceiver, sendData)
lcl_trns_->updateSensor(batteries);
lcl_trns_->updateSensor(sensors);
lcl_trns_->updateSensor(local_paths);
lcl_trns_->send();

std::cout << "Sending data" << std::endl;
// EXPECT_TRUE(lcl_trns_->send());
}

0 comments on commit 9d4baef

Please sign in to comment.