mediapipe/mediapipe2/framework/api2/port_test.cc
2021-06-10 23:01:19 +00:00

27 lines
589 B
C++

#include "mediapipe/framework/api2/port.h"
#include "mediapipe/framework/port/gtest.h"
namespace mediapipe {
namespace api2 {
namespace {
TEST(PortTest, IntInput) {
static constexpr auto port = Input<int>("FOO");
EXPECT_EQ(port.type_id(), typeid(int).hash_code());
}
TEST(PortTest, OptionalInput) {
static constexpr auto port = Input<float>::Optional("BAR");
EXPECT_TRUE(port.IsOptional());
}
TEST(PortTest, Tag) {
static constexpr auto port = Input<int>("FOO");
EXPECT_EQ(std::string(port.Tag()), "FOO");
}
} // namespace
} // namespace api2
} // namespace mediapipe