lots of work on determinism in the linux driver.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user