Commit 32ef4580 authored by Thomas Braun's avatar Thomas Braun
Browse files

test: Add AddDeviceWithProtoAndInstWorks

parent c6ce0ed5
Loading
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -249,6 +249,27 @@ BOOST_AUTO_TEST_CASE(AddDeviceWorks)
    }
}

BOOST_AUTO_TEST_CASE(AddDeviceWithProtoAndInstWorks)
{
    // can handle protocol and instance prefixes
    {
        auto dd = MakeDeviceDataStringArray({"server/instance", "tango://instance/a/b/c", "myClass"});
        BOOST_CHECK_NO_THROW(dp->command_inout("DbAddDevice", dd));
    }

    // get devices
    {
        auto dd = MakeDeviceDataStringArray({"server/instance", "myClass"});

        Tango::DeviceData reply;
        BOOST_CHECK_NO_THROW(reply = dp->command_inout("DbGetDeviceList", dd));
        auto vec = ExtractStringVector(reply);

        std::vector<std::string> ref = {"a/b/c"};
        BOOST_CHECK_EQUAL_COLLECTIONS(std::begin(vec), std::end(vec), std::begin(ref), std::end(ref));
    }
}

BOOST_AUTO_TEST_CASE(DBInfoDoesNotThrow)
{
    Tango::DeviceData reply;