// This is simply a script that tries serializing protocol buffer in text // format. Nothing special here and no actual code is being tested. #include #include "google/protobuf/text_format.h" #include "gtest/gtest.h" #include "caffe/proto/caffe.pb.h" #include "caffe/test/test_caffe_main.hpp" namespace caffe { class ProtoTest : public ::testing::Test {}; TEST_F(ProtoTest, TestSerialization) { LayerParameter param; param.set_name("test"); param.set_type("Test"); std::cout << "Printing in binary format." << std::endl; std::cout << param.SerializeAsString() << std::endl; std::cout << "Printing in text format." << std::endl; std::string str; google::protobuf::TextFormat::PrintToString(param, &str); std::cout << str << std::endl; EXPECT_TRUE(true); } } // namespace caffe