mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Client and server tests: Prefix keys for compatibility.
The NetworkTable interface prefixes with /, so this makes simple interoperability testing easier.
This commit is contained in:
@@ -14,12 +14,12 @@ int main() {
|
||||
0);
|
||||
nt::StartClient("127.0.0.1", 10000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
auto foo = nt::GetEntryValue("foo");
|
||||
auto foo = nt::GetEntryValue("/foo");
|
||||
if (foo && foo->IsDouble()) printf("Got foo: %g\n", foo->GetDouble());
|
||||
nt::SetEntryValue("bar", nt::Value::MakeBoolean(false));
|
||||
nt::SetEntryFlags("bar", NT_PERSISTENT);
|
||||
nt::SetEntryValue("bar2", nt::Value::MakeBoolean(true));
|
||||
nt::SetEntryValue("bar2", nt::Value::MakeBoolean(false));
|
||||
nt::SetEntryValue("bar2", nt::Value::MakeBoolean(true));
|
||||
nt::SetEntryValue("/bar", nt::Value::MakeBoolean(false));
|
||||
nt::SetEntryFlags("/bar", NT_PERSISTENT);
|
||||
nt::SetEntryValue("/bar2", nt::Value::MakeBoolean(true));
|
||||
nt::SetEntryValue("/bar2", nt::Value::MakeBoolean(false));
|
||||
nt::SetEntryValue("/bar2", nt::Value::MakeBoolean(true));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ int main() {
|
||||
0);
|
||||
nt::StartServer("persistent.ini", "", 10000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
nt::SetEntryValue("foo", nt::Value::MakeDouble(0.5));
|
||||
nt::SetEntryFlags("foo", NT_PERSISTENT);
|
||||
nt::SetEntryValue("foo2", nt::Value::MakeDouble(0.5));
|
||||
nt::SetEntryValue("foo2", nt::Value::MakeDouble(0.7));
|
||||
nt::SetEntryValue("foo2", nt::Value::MakeDouble(0.6));
|
||||
nt::SetEntryValue("foo2", nt::Value::MakeDouble(0.5));
|
||||
nt::SetEntryValue("/foo", nt::Value::MakeDouble(0.5));
|
||||
nt::SetEntryFlags("/foo", NT_PERSISTENT);
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.5));
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.7));
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.6));
|
||||
nt::SetEntryValue("/foo2", nt::Value::MakeDouble(0.5));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user