Testing the serializer

This commit is contained in:
mandlm 2015-02-22 20:29:32 +01:00
parent c204382126
commit a25a51f166

View File

@ -1,4 +1,5 @@
#include <iostream>
#include <string>
#include "proto/client.pb.h"
@ -6,5 +7,17 @@ int main(int argc, char **argv)
{
std::cout << "Client running" << std::endl;
std::string bufferString;
client::ClientInfo clientInfoIn;
clientInfoIn.set_name("Herbert");
clientInfoIn.SerializeToString(&bufferString);
client::ClientInfo clientInfoOut;
clientInfoOut.ParseFromString(bufferString);
std::cout << "read: " << clientInfoOut.name() << std::endl;
return 0;
}