Add NTTable helper

This commit is contained in:
Michael Davidsaver
2023-08-31 10:35:54 +02:00
parent 877dc12d35
commit 13d02530cf
4 changed files with 126 additions and 1 deletions
+17 -1
View File
@@ -82,13 +82,29 @@ void testNTEnum()
testTrue(top.idStartsWith("epics:nt/NTEnum:"))<<"\n"<<top;
}
void testNTTable()
{
testDiag("In %s", __func__);
auto top = nt::NTTable{}
.add_column(TypeCode::Int32, "A", "Col A")
.add_column(TypeCode::String, "B", "Col B")
.create();
shared_array<const std::string> labels({"Col A", "Col B"});
testArrEq(top["labels"].as<shared_array<const std::string>>(), labels);
testTrue(top["value.A"].type()==TypeCode::Int32A);
testTrue(top["value.B"].type()==TypeCode::StringA);
}
} // namespace
MAIN(testnt) {
testPlan(18);
testPlan(21);
testNTScalar();
testNTNDArray();
testNTURI();
testNTEnum();
testNTTable();
return testDone();
}