diff options
author | 2016-07-13 13:46:05 -0700 | |
---|---|---|
committer | 2016-07-13 13:46:05 -0700 | |
commit | d4c5bd8512fa5273e24f712343be6b97c0004bfe (patch) | |
tree | 759deb34b0458ceb5e81a0db958e09d651f7151e /test/cpp | |
parent | 6ca5437b61fe32cbf2636ca436a8585ff66d574c (diff) | |
parent | 7a70bb5486c199fb32742b2f1617e8206846cf65 (diff) |
Merge github.com:grpc/grpc into delayed-write
Diffstat (limited to 'test/cpp')
-rw-r--r-- | test/cpp/util/slice_test.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cpp/util/slice_test.cc b/test/cpp/util/slice_test.cc index de7ff031ab..45799ae157 100644 --- a/test/cpp/util/slice_test.cc +++ b/test/cpp/util/slice_test.cc @@ -68,6 +68,16 @@ TEST_F(SliceTest, Empty) { CheckSlice(empty_slice, ""); } +TEST_F(SliceTest, Cslice) { + gpr_slice s = gpr_slice_from_copied_string(kContent); + Slice spp(s, Slice::STEAL_REF); + CheckSlice(spp, kContent); + gpr_slice c_slice = spp.c_slice(); + EXPECT_EQ(GPR_SLICE_START_PTR(s), GPR_SLICE_START_PTR(c_slice)); + EXPECT_EQ(GPR_SLICE_END_PTR(s), GPR_SLICE_END_PTR(c_slice)); + gpr_slice_unref(c_slice); +} + } // namespace } // namespace grpc |