Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Dec 14, 2011
1 parent bc615d2 commit 4bf6375
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions binding/lua/test2.lua
@@ -0,0 +1,18 @@
local protobuf = require "protobuf"

addr = io.open("../../build/addressbook.pb","rb")
buffer = addr:read "*a"
addr:close()
protobuf.register(buffer)

local person = {
name = "Alice",
id = 123,
}

for i=1,1000000 do
-- local buffer = protobuf.pack("tutorial.Person name id", "Alice", 123)
-- protobuf.unpack("tutorial.Person name id", buffer)
local buffer = protobuf.encode("tutorial.Person", person)
local t = protobuf.decode("tutorial.Person", buffer)
end

0 comments on commit 4bf6375

Please sign in to comment.