| 596 | string ClsLua::pool_name; |
| 597 | |
| 598 | TEST_F(ClsLua, Write) { |
| 599 | /* write some data into object */ |
| 600 | string written = "Hello World"; |
| 601 | bufferlist inbl; |
| 602 | encode(written, inbl); |
| 603 | ASSERT_EQ(0, clslua_exec(test_script, &inbl, "write")); |
| 604 | |
| 605 | /* have Lua read out of the object */ |
| 606 | uint64_t size; |
| 607 | bufferlist outbl; |
| 608 | ASSERT_EQ(0, ioctx.stat(oid, &size, NULL)); |
| 609 | ASSERT_EQ(size, (uint64_t)ioctx.read(oid, outbl, size, 0) ); |
| 610 | |
| 611 | /* compare what Lua read to what we wrote */ |
| 612 | string read; |
| 613 | decode(read, outbl); |
| 614 | ASSERT_EQ(read, written); |
| 615 | } |
| 616 | |
| 617 | TEST_F(ClsLua, SyntaxError) { |
| 618 | ASSERT_EQ(-EIO, clslua_exec("-")); |
nothing calls this directly
no test coverage detected