diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-03 20:26:11 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-03 20:26:11 +0000 |
commit | 148779df305667b6942fee7e758fdf81a6498f38 (patch) | |
tree | 976d85fb9cb4bc8ed54348b045f742be90e10c57 /unittests/Support/BinaryStreamTest.cpp | |
parent | a303c417bbdb53703c2c17398b08486bde78f1f6 (diff) |
Notes
Diffstat (limited to 'unittests/Support/BinaryStreamTest.cpp')
-rw-r--r-- | unittests/Support/BinaryStreamTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/unittests/Support/BinaryStreamTest.cpp b/unittests/Support/BinaryStreamTest.cpp index 74c51e382d99..41567dad6226 100644 --- a/unittests/Support/BinaryStreamTest.cpp +++ b/unittests/Support/BinaryStreamTest.cpp @@ -358,14 +358,14 @@ TEST_F(BinaryStreamTest, VarStreamArray) { struct StringExtractor { public: - typedef uint32_t ContextType; + typedef uint32_t &ContextType; static Error extract(BinaryStreamRef Stream, uint32_t &Len, StringRef &Item, - uint32_t *Index) { - if (*Index == 0) + uint32_t &Index) { + if (Index == 0) Len = strlen("1. Test"); - else if (*Index == 1) + else if (Index == 1) Len = strlen("2. Longer Test"); - else if (*Index == 2) + else if (Index == 2) Len = strlen("3. Really Long Test"); else Len = strlen("4. Super Extra Longest Test Of All"); @@ -374,14 +374,14 @@ TEST_F(BinaryStreamTest, VarStreamArray) { return EC; Item = StringRef(reinterpret_cast<const char *>(Bytes.data()), Bytes.size()); - ++(*Index); + ++Index; return Error::success(); } }; for (auto &Stream : Streams) { uint32_t Context = 0; - VarStreamArray<StringRef, StringExtractor> Array(*Stream.Input, &Context); + VarStreamArray<StringRef, StringExtractor> Array(*Stream.Input, Context); auto Iter = Array.begin(); ASSERT_EQ("1. Test", *Iter++); ASSERT_EQ("2. Longer Test", *Iter++); |