diff options
Diffstat (limited to 'unittests/Support/BinaryStreamTest.cpp')
-rw-r--r-- | unittests/Support/BinaryStreamTest.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/unittests/Support/BinaryStreamTest.cpp b/unittests/Support/BinaryStreamTest.cpp index 1ce74cbb722b..795c18902a9b 100644 --- a/unittests/Support/BinaryStreamTest.cpp +++ b/unittests/Support/BinaryStreamTest.cpp @@ -416,9 +416,7 @@ TEST_F(BinaryStreamTest, VarStreamArray) { struct StringExtractor { public: - typedef uint32_t &ContextType; - static Error extract(BinaryStreamRef Stream, uint32_t &Len, StringRef &Item, - uint32_t &Index) { + Error operator()(BinaryStreamRef Stream, uint32_t &Len, StringRef &Item) { if (Index == 0) Len = strlen("1. Test"); else if (Index == 1) @@ -435,11 +433,12 @@ TEST_F(BinaryStreamTest, VarStreamArray) { ++Index; return Error::success(); } + + uint32_t Index = 0; }; for (auto &Stream : Streams) { - uint32_t Context = 0; - VarStreamArray<StringRef, StringExtractor> Array(*Stream.Input, Context); + VarStreamArray<StringRef, StringExtractor> Array(*Stream.Input); auto Iter = Array.begin(); ASSERT_EQ("1. Test", *Iter++); ASSERT_EQ("2. Longer Test", *Iter++); |