lots of work on determinism in the linux driver.

This commit is contained in:
2022-02-18 03:59:21 -05:00
parent 6a6d2c7f75
commit ba1e923b5a
10 changed files with 175 additions and 110 deletions

View File

@@ -1,6 +1,7 @@
#include "driver-util.hpp"
#include "luastack.hpp"
#include "util.hpp"
namespace drv {
@@ -16,6 +17,19 @@ void split_host_port(std::string_view target, UmmString &host, UmmString &port)
}
}
UmmStringVec parse_control_lst(std::string_view ctrl) {
UmmStringVec result;
while (!ctrl.empty()) {
std::string_view line = util::sv_read_line(ctrl);
std::string_view trimmed = util::sv_trim(line);
if ((trimmed.size() > 0) && (trimmed[0] != '#')) {
result.emplace_back(trimmed);
}
}
return result;
}
} // namespace drv
LuaDefine(unittests_driverutil, "", "some unit tests") {
@@ -24,6 +38,7 @@ LuaDefine(unittests_driverutil, "", "some unit tests") {
drv::split_host_port("stanford.edu:80", host, port);
LuaAssertStrEq(L, host, "stanford.edu");
LuaAssertStrEq(L, port, "80");
return 0;
}