Commit ecab6f46 authored by Anton Bukov's avatar Anton Bukov

Reimplemented a lot, has a compiler infinite recursion

parent a32c5293
...@@ -7,3 +7,5 @@ ipch ...@@ -7,3 +7,5 @@ ipch
*.suo *.suo
[Bb]uild* [Bb]uild*
nbproject nbproject
.idea
cmake-build-debug
This diff is collapsed.
This diff is collapsed.
...@@ -47,5 +47,5 @@ TEST(Avg, FiveStringsLen) ...@@ -47,5 +47,5 @@ TEST(Avg, FiveStringsLen)
auto rng = from(src); auto rng = from(src);
EXPECT_EQ(5, rng.avg<int>([](const std::string & str){return str.size();})); EXPECT_EQ(5, rng.avg([](const std::string & str){return str.size();}));
} }
...@@ -27,7 +27,7 @@ TEST(BitsRange, OneByteHL) ...@@ -27,7 +27,7 @@ TEST(BitsRange, OneByteHL)
int ans[] = {1,0,1,0,1,0,1,0}; int ans[] = {1,0,1,0,1,0,1,0};
auto rng = from(src); auto rng = from(src);
auto dst = rng.bits(HighToLow); auto dst = rng.bits(BitsHighToLow);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -38,7 +38,7 @@ TEST(BitsRange, OneByteLH) ...@@ -38,7 +38,7 @@ TEST(BitsRange, OneByteLH)
int ans[] = {0,1,0,1,0,1,0,1}; int ans[] = {0,1,0,1,0,1,0,1};
auto rng = from(src); auto rng = from(src);
auto dst = rng.bits(LowToHigh); auto dst = rng.bits(BitsLowToHigh);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -74,7 +74,7 @@ TEST(BitsRange, OneIntHL) ...@@ -74,7 +74,7 @@ TEST(BitsRange, OneIntHL)
}; };
auto rng = from(src); auto rng = from(src);
auto dst = rng.bits(HighToLow); auto dst = rng.bits(BitsHighToLow);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -91,8 +91,8 @@ TEST(BitsRange, OneIntLH) ...@@ -91,8 +91,8 @@ TEST(BitsRange, OneIntLH)
}; };
auto rng = from(src); auto rng = from(src);
auto dst = rng.bits(LowToHigh,FirstToLast); auto dst = rng.bits(BitsLowToHigh,BytesFirstToLast);
auto vvv = dst.toVector(); auto vvv = dst.toStdVector();
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -138,7 +138,7 @@ TEST(BitsRange, IntsHL) ...@@ -138,7 +138,7 @@ TEST(BitsRange, IntsHL)
}; };
auto rng = from(src); auto rng = from(src);
auto dst = rng.bits(HighToLow); auto dst = rng.bits(BitsHighToLow);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -160,7 +160,7 @@ TEST(BitsRange, IntsLH) ...@@ -160,7 +160,7 @@ TEST(BitsRange, IntsLH)
}; };
auto rng = from(src); auto rng = from(src);
auto dst = rng.bits(LowToHigh); auto dst = rng.bits(BitsLowToHigh);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -27,7 +27,7 @@ TEST(BytesRange, OneByteFL) ...@@ -27,7 +27,7 @@ TEST(BytesRange, OneByteFL)
int ans[] = {0xAA}; int ans[] = {0xAA};
auto rng = from(src); auto rng = from(src);
auto dst = rng.bytes(FirstToLast); auto dst = rng.bytes(BytesFirstToLast);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -38,7 +38,7 @@ TEST(BytesRange, OneByteLF) ...@@ -38,7 +38,7 @@ TEST(BytesRange, OneByteLF)
int ans[] = {0xAA}; int ans[] = {0xAA};
auto rng = from(src); auto rng = from(src);
auto dst = rng.bytes(LastToFirst); auto dst = rng.bytes(BytesLastToFirst);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -62,7 +62,7 @@ TEST(BytesRange, OneIntFL) ...@@ -62,7 +62,7 @@ TEST(BytesRange, OneIntFL)
int ans[] = {0x78,0x56,0x34,0x12}; int ans[] = {0x78,0x56,0x34,0x12};
auto rng = from(src); auto rng = from(src);
auto dst = rng.bytes(FirstToLast); auto dst = rng.bytes(BytesFirstToLast);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -73,7 +73,7 @@ TEST(BytesRange, OneIntLF) ...@@ -73,7 +73,7 @@ TEST(BytesRange, OneIntLF)
int ans[] = {0x12,0x34,0x56,0x78}; int ans[] = {0x12,0x34,0x56,0x78};
auto rng = from(src); auto rng = from(src);
auto dst = rng.bytes(LastToFirst); auto dst = rng.bytes(BytesLastToFirst);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -90,7 +90,7 @@ TEST(BytesRange, IntsDefault) ...@@ -90,7 +90,7 @@ TEST(BytesRange, IntsDefault)
}; };
auto rng = from(src); auto rng = from(src);
auto dst = rng.bytes(FirstToLast); auto dst = rng.bytes(BytesFirstToLast);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -105,7 +105,7 @@ TEST(BytesRange, IntsFL) ...@@ -105,7 +105,7 @@ TEST(BytesRange, IntsFL)
}; };
auto rng = from(src); auto rng = from(src);
auto dst = rng.bytes(FirstToLast); auto dst = rng.bytes(BytesFirstToLast);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -120,7 +120,7 @@ TEST(BytesRange, IntsLF) ...@@ -120,7 +120,7 @@ TEST(BytesRange, IntsLF)
}; };
auto rng = from(src); auto rng = from(src);
auto dst = rng.bytes(LastToFirst); auto dst = rng.bytes(BytesLastToFirst);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -16,7 +16,7 @@ void CheckRangeEqArray(R dst, T (&ans)[N], F f) ...@@ -16,7 +16,7 @@ void CheckRangeEqArray(R dst, T (&ans)[N], F f)
for (unsigned i = 0; i < N; i++) for (unsigned i = 0; i < N; i++)
EXPECT_EQ(f(ans[i]), f(dst.nextObject())); EXPECT_EQ(f(ans[i]), f(dst.nextObject()));
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
template<typename R, typename T, unsigned N> template<typename R, typename T, unsigned N>
...@@ -25,7 +25,7 @@ void CheckRangeEqArray(R dst, T (&ans)[N]) ...@@ -25,7 +25,7 @@ void CheckRangeEqArray(R dst, T (&ans)[N])
for (unsigned i = 0; i < N; i++) for (unsigned i = 0; i < N; i++)
EXPECT_EQ(ans[i], dst.nextObject()); EXPECT_EQ(ans[i], dst.nextObject());
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
template<typename T, unsigned N> template<typename T, unsigned N>
......
...@@ -27,8 +27,8 @@ TEST(DotCall, BytesRange) ...@@ -27,8 +27,8 @@ TEST(DotCall, BytesRange)
}; };
auto dstFL1 = from(src).bytes(); auto dstFL1 = from(src).bytes();
auto dstFL2 = from(src).bytes(FirstToLast); auto dstFL2 = from(src).bytes(BytesFirstToLast);
auto dstLF1 = from(src).bytes(LastToFirst); auto dstLF1 = from(src).bytes(BytesLastToFirst);
CheckRangeEqArray(dstFL1, ansFL); CheckRangeEqArray(dstFL1, ansFL);
CheckRangeEqArray(dstFL2, ansFL); CheckRangeEqArray(dstFL2, ansFL);
...@@ -48,8 +48,8 @@ TEST(DotCall, UnbytesRange) ...@@ -48,8 +48,8 @@ TEST(DotCall, UnbytesRange)
unsigned ansLF[] = {0x78563412,0xDDCCBBAA}; unsigned ansLF[] = {0x78563412,0xDDCCBBAA};
auto dstFL1 = from(src).unbytes<unsigned>(); auto dstFL1 = from(src).unbytes<unsigned>();
auto dstFL2 = from(src).unbytes<unsigned>(FirstToLast); auto dstFL2 = from(src).unbytes<unsigned>(BytesFirstToLast);
auto dstLF1 = from(src).unbytes<unsigned>(LastToFirst); auto dstLF1 = from(src).unbytes<unsigned>(BytesLastToFirst);
CheckRangeEqArray(dstFL1, ansFL); CheckRangeEqArray(dstFL1, ansFL);
CheckRangeEqArray(dstFL2, ansFL); CheckRangeEqArray(dstFL2, ansFL);
...@@ -77,9 +77,9 @@ TEST(DotCall, BitsRangeHL) ...@@ -77,9 +77,9 @@ TEST(DotCall, BitsRangeHL)
}; };
auto dstFL1 = from(src).bits(); auto dstFL1 = from(src).bits();
auto dstFL2 = from(src).bits(HighToLow); auto dstFL2 = from(src).bits(BitsHighToLow);
auto dstFL3 = from(src).bits(HighToLow,FirstToLast); auto dstFL3 = from(src).bits(BitsHighToLow,BytesFirstToLast);
auto dstLF1 = from(src).bits(HighToLow,LastToFirst); auto dstLF1 = from(src).bits(BitsHighToLow,BytesLastToFirst);
CheckRangeEqArray(dstFL1, ansFL); CheckRangeEqArray(dstFL1, ansFL);
CheckRangeEqArray(dstFL2, ansFL); CheckRangeEqArray(dstFL2, ansFL);
...@@ -105,9 +105,9 @@ TEST(DotCall, BitsRangeLH) ...@@ -105,9 +105,9 @@ TEST(DotCall, BitsRangeLH)
1,0,1,1,1,0,1,1, 1,0,1,1,1,0,1,1,
}; };
auto dstFL1 = from(src).bits(LowToHigh); auto dstFL1 = from(src).bits(BitsLowToHigh);
auto dstFL2 = from(src).bits(LowToHigh,FirstToLast); auto dstFL2 = from(src).bits(BitsLowToHigh,BytesFirstToLast);
auto dstLF1 = from(src).bits(LowToHigh,LastToFirst); auto dstLF1 = from(src).bits(BitsLowToHigh,BytesLastToFirst);
CheckRangeEqArray(dstFL1, ansFL); CheckRangeEqArray(dstFL1, ansFL);
CheckRangeEqArray(dstFL2, ansFL); CheckRangeEqArray(dstFL2, ansFL);
...@@ -130,10 +130,10 @@ TEST(DotCall, UnbitsRangeHLFL) ...@@ -130,10 +130,10 @@ TEST(DotCall, UnbitsRangeHLFL)
unsigned ansLF_1i[] = {0xDDCCBBAA}; unsigned ansLF_1i[] = {0xDDCCBBAA};
auto dst1_4b = from(src).unbits(); auto dst1_4b = from(src).unbits();
auto dst2_4b = from(src).unbits(HighToLow); auto dst2_4b = from(src).unbits(BitsHighToLow);
auto dst1_1i = from(src).unbits<unsigned>(HighToLow); auto dst1_1i = from(src).unbits<unsigned>(BitsHighToLow);
auto dst2_1i = from(src).unbits<unsigned>(HighToLow,FirstToLast); auto dst2_1i = from(src).unbits<unsigned>(BitsHighToLow,BytesFirstToLast);
auto dst3_1i = from(src).unbits<unsigned>(HighToLow,LastToFirst); auto dst3_1i = from(src).unbits<unsigned>(BitsHighToLow,BytesLastToFirst);
CheckRangeEqArray(dst1_4b, ans_4b); CheckRangeEqArray(dst1_4b, ans_4b);
CheckRangeEqArray(dst2_4b, ans_4b); CheckRangeEqArray(dst2_4b, ans_4b);
...@@ -160,9 +160,9 @@ TEST(DotCall, UnbitsRangeHLFL) ...@@ -160,9 +160,9 @@ TEST(DotCall, UnbitsRangeHLFL)
// 1,0,1,1,1,0,1,1, // 1,0,1,1,1,0,1,1,
// }; // };
// //
// auto dstFL1 = from(src).bits<LowToHigh>(); // auto dstFL1 = from(src).bits<BitsLowToHigh>();
// auto dstFL2 = from(src).bits<LowToHigh,FirstToLast>(); // auto dstFL2 = from(src).bits<BitsLowToHigh,BytesFirstToLast>();
// auto dstLF1 = from(src).bits<LowToHigh,LastToFirst>(); // auto dstLF1 = from(src).bits<BitsLowToHigh,BytesLastToFirst>();
// //
// CheckRangeEqArray(dstFL1, ansFL); // CheckRangeEqArray(dstFL1, ansFL);
// CheckRangeEqArray(dstFL2, ansFL); // CheckRangeEqArray(dstFL2, ansFL);
......
...@@ -41,7 +41,7 @@ TEST(GroupByRange, IntsFront) ...@@ -41,7 +41,7 @@ TEST(GroupByRange, IntsFront)
CheckRangeEqArray(dst.back(), ans_0); CheckRangeEqArray(dst.back(), ans_0);
CheckRangeEqArray(dst.popFront(), ans_0); CheckRangeEqArray(dst.popFront(), ans_0);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(GroupByRange, IntsBack) TEST(GroupByRange, IntsBack)
...@@ -73,7 +73,7 @@ TEST(GroupByRange, IntsBack) ...@@ -73,7 +73,7 @@ TEST(GroupByRange, IntsBack)
CheckRangeEqArray(dst.back(), ans_1); CheckRangeEqArray(dst.back(), ans_1);
CheckRangeEqArray(dst.popBack(), ans_1); CheckRangeEqArray(dst.popBack(), ans_1);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -126,7 +126,7 @@ TEST(GroupByRange, CountChildrenByAge) ...@@ -126,7 +126,7 @@ TEST(GroupByRange, CountChildrenByAge)
CheckRangeEqArray(dst.back(), ans_true); CheckRangeEqArray(dst.back(), ans_true);
CheckRangeEqArray(dst.popFront(), ans_true); CheckRangeEqArray(dst.popFront(), ans_true);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
*/ */
...@@ -126,5 +126,5 @@ TEST(IterRange, EmptyVector) ...@@ -126,5 +126,5 @@ TEST(IterRange, EmptyVector)
auto rng = from(src); auto rng = from(src);
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
...@@ -28,7 +28,7 @@ TEST(Linq, WhereOdd) ...@@ -28,7 +28,7 @@ TEST(Linq, WhereOdd)
EXPECT_EQ(i, rng.nextObject()); EXPECT_EQ(i, rng.nextObject());
} }
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
TEST(Linq, WhereOdd_WhereLess) TEST(Linq, WhereOdd_WhereLess)
...@@ -51,7 +51,7 @@ TEST(Linq, WhereOdd_WhereLess) ...@@ -51,7 +51,7 @@ TEST(Linq, WhereOdd_WhereLess)
EXPECT_EQ(i, rng.nextObject()); EXPECT_EQ(i, rng.nextObject());
} }
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
TEST(Linq, WhereLess_WhereOdd) TEST(Linq, WhereLess_WhereOdd)
...@@ -215,7 +215,7 @@ TEST(Linq, Pointer_Front) ...@@ -215,7 +215,7 @@ TEST(Linq, Pointer_Front)
EXPECT_EQ(i, dst.nextObject()); EXPECT_EQ(i, dst.nextObject());
} }
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
...@@ -232,7 +232,7 @@ TEST(Linq, Array_Front) ...@@ -232,7 +232,7 @@ TEST(Linq, Array_Front)
EXPECT_EQ(i, dst.nextObject()); EXPECT_EQ(i, dst.nextObject());
} }
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
......
...@@ -63,7 +63,7 @@ TEST(OrderByRange, NoElements) ...@@ -63,7 +63,7 @@ TEST(OrderByRange, NoElements)
auto rng = from(src); auto rng = from(src);
auto dst = rng.orderBy(); auto dst = rng.orderBy();
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
......
...@@ -50,7 +50,7 @@ TEST(SkipRange, ManyToZero) ...@@ -50,7 +50,7 @@ TEST(SkipRange, ManyToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skip(6); auto dst = rng.skip(6);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipRange, ManyToZeroLess) TEST(SkipRange, ManyToZeroLess)
...@@ -60,7 +60,7 @@ TEST(SkipRange, ManyToZeroLess) ...@@ -60,7 +60,7 @@ TEST(SkipRange, ManyToZeroLess)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skip(10); auto dst = rng.skip(10);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -83,7 +83,7 @@ TEST(SkipRange, OneToZero) ...@@ -83,7 +83,7 @@ TEST(SkipRange, OneToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skip(1); auto dst = rng.skip(1);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipRange, OneToZeroLess) TEST(SkipRange, OneToZeroLess)
...@@ -93,7 +93,7 @@ TEST(SkipRange, OneToZeroLess) ...@@ -93,7 +93,7 @@ TEST(SkipRange, OneToZeroLess)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skip(2); auto dst = rng.skip(2);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipRange, ZeroToZero) TEST(SkipRange, ZeroToZero)
...@@ -103,7 +103,7 @@ TEST(SkipRange, ZeroToZero) ...@@ -103,7 +103,7 @@ TEST(SkipRange, ZeroToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skip(0); auto dst = rng.skip(0);
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
TEST(SkipRange, ZeroToZeroLess) TEST(SkipRange, ZeroToZeroLess)
...@@ -113,7 +113,7 @@ TEST(SkipRange, ZeroToZeroLess) ...@@ -113,7 +113,7 @@ TEST(SkipRange, ZeroToZeroLess)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skip(2); auto dst = rng.skip(2);
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -194,7 +194,7 @@ TEST(SkipWhileRange, ManyToZero) ...@@ -194,7 +194,7 @@ TEST(SkipWhileRange, ManyToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile([](int it){return it > 0;}); auto dst = rng.skipWhile([](int it){return it > 0;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange_i, ManyToZeroeByIndex) TEST(SkipWhileRange_i, ManyToZeroeByIndex)
...@@ -204,7 +204,7 @@ TEST(SkipWhileRange_i, ManyToZeroeByIndex) ...@@ -204,7 +204,7 @@ TEST(SkipWhileRange_i, ManyToZeroeByIndex)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile_i([](int /*it*/, int idx){return idx < 6;}); auto dst = rng.skipWhile_i([](int /*it*/, int idx){return idx < 6;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange_i, ManyToZeroByItemValue) TEST(SkipWhileRange_i, ManyToZeroByItemValue)
...@@ -214,7 +214,7 @@ TEST(SkipWhileRange_i, ManyToZeroByItemValue) ...@@ -214,7 +214,7 @@ TEST(SkipWhileRange_i, ManyToZeroByItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile_i([](int it, int /*idx*/){return it > 0;}); auto dst = rng.skipWhile_i([](int it, int /*idx*/){return it > 0;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange_i, ManyToZeroIndexAndItemValue) TEST(SkipWhileRange_i, ManyToZeroIndexAndItemValue)
...@@ -224,7 +224,7 @@ TEST(SkipWhileRange_i, ManyToZeroIndexAndItemValue) ...@@ -224,7 +224,7 @@ TEST(SkipWhileRange_i, ManyToZeroIndexAndItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile_i([](int it, int idx){return idx != it;}); auto dst = rng.skipWhile_i([](int it, int idx){return idx != it;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -280,7 +280,7 @@ TEST(SkipWhileRange, OneToZero) ...@@ -280,7 +280,7 @@ TEST(SkipWhileRange, OneToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile([](int it){return it == 5;}); auto dst = rng.skipWhile([](int it){return it == 5;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange_i, OneToZeroByIndex) TEST(SkipWhileRange_i, OneToZeroByIndex)
...@@ -290,7 +290,7 @@ TEST(SkipWhileRange_i, OneToZeroByIndex) ...@@ -290,7 +290,7 @@ TEST(SkipWhileRange_i, OneToZeroByIndex)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile_i([](int /*it*/, int idx){return idx < 6;}); auto dst = rng.skipWhile_i([](int /*it*/, int idx){return idx < 6;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange_i, OneToZeroByItemValue) TEST(SkipWhileRange_i, OneToZeroByItemValue)
...@@ -300,7 +300,7 @@ TEST(SkipWhileRange_i, OneToZeroByItemValue) ...@@ -300,7 +300,7 @@ TEST(SkipWhileRange_i, OneToZeroByItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile_i([](int it, int /*idx*/){return it > 0;}); auto dst = rng.skipWhile_i([](int it, int /*idx*/){return it > 0;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange_i, OneToZeroIndexAndItemValue) TEST(SkipWhileRange_i, OneToZeroIndexAndItemValue)
...@@ -310,7 +310,7 @@ TEST(SkipWhileRange_i, OneToZeroIndexAndItemValue) ...@@ -310,7 +310,7 @@ TEST(SkipWhileRange_i, OneToZeroIndexAndItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile_i([](int it, int idx){return idx != it;}); auto dst = rng.skipWhile_i([](int it, int idx){return idx != it;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange, ZeroToZero) TEST(SkipWhileRange, ZeroToZero)
...@@ -320,7 +320,7 @@ TEST(SkipWhileRange, ZeroToZero) ...@@ -320,7 +320,7 @@ TEST(SkipWhileRange, ZeroToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile([](int){return false;}); auto dst = rng.skipWhile([](int){return false;});
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
TEST(SkipWhileRange_i, ZeroToZero) TEST(SkipWhileRange_i, ZeroToZero)
...@@ -330,7 +330,7 @@ TEST(SkipWhileRange_i, ZeroToZero) ...@@ -330,7 +330,7 @@ TEST(SkipWhileRange_i, ZeroToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.skipWhile_i([](int /*it*/, int /*idx*/){return true;}); auto dst = rng.skipWhile_i([](int /*it*/, int /*idx*/){return true;});
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -61,7 +61,7 @@ TEST(TakeRange, ManyToZero) ...@@ -61,7 +61,7 @@ TEST(TakeRange, ManyToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.take(0); auto dst = rng.take(0);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -95,7 +95,7 @@ TEST(TakeRange, OneToZero) ...@@ -95,7 +95,7 @@ TEST(TakeRange, OneToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.take(0); auto dst = rng.take(0);
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeRange, ZeroToZero) TEST(TakeRange, ZeroToZero)
...@@ -105,7 +105,7 @@ TEST(TakeRange, ZeroToZero) ...@@ -105,7 +105,7 @@ TEST(TakeRange, ZeroToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.take(0); auto dst = rng.take(0);
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -193,7 +193,7 @@ TEST(TakeWhileRange, ManyToZero) ...@@ -193,7 +193,7 @@ TEST(TakeWhileRange, ManyToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile([](int it){return it < 0;}); auto dst = rng.takeWhile([](int it){return it < 0;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange_i, ManyToZeroByIndex) TEST(TakeWhileRange_i, ManyToZeroByIndex)
...@@ -203,7 +203,7 @@ TEST(TakeWhileRange_i, ManyToZeroByIndex) ...@@ -203,7 +203,7 @@ TEST(TakeWhileRange_i, ManyToZeroByIndex)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile_i([](int /*it*/, int idx){return idx > 0;}); auto dst = rng.takeWhile_i([](int /*it*/, int idx){return idx > 0;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange_i, ManyToZeroByItemValue) TEST(TakeWhileRange_i, ManyToZeroByItemValue)
...@@ -213,7 +213,7 @@ TEST(TakeWhileRange_i, ManyToZeroByItemValue) ...@@ -213,7 +213,7 @@ TEST(TakeWhileRange_i, ManyToZeroByItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile_i([](int it, int /*idx*/){return it > 2;}); auto dst = rng.takeWhile_i([](int it, int /*idx*/){return it > 2;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange_i, ManyToZeroByIdexAndItemValue) TEST(TakeWhileRange_i, ManyToZeroByIdexAndItemValue)
...@@ -223,7 +223,7 @@ TEST(TakeWhileRange_i, ManyToZeroByIdexAndItemValue) ...@@ -223,7 +223,7 @@ TEST(TakeWhileRange_i, ManyToZeroByIdexAndItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile_i([](int it, int idx){return it < 0 || idx > 0;}); auto dst = rng.takeWhile_i([](int it, int idx){return it < 0 || idx > 0;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -279,7 +279,7 @@ TEST(TakeWhileRange, OneToZero) ...@@ -279,7 +279,7 @@ TEST(TakeWhileRange, OneToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile([](int){return false;}); auto dst = rng.takeWhile([](int){return false;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange_i, OneToZeroByIndex) TEST(TakeWhileRange_i, OneToZeroByIndex)
...@@ -289,7 +289,7 @@ TEST(TakeWhileRange_i, OneToZeroByIndex) ...@@ -289,7 +289,7 @@ TEST(TakeWhileRange_i, OneToZeroByIndex)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile_i([](int /*it*/, int idx){return idx > 0;}); auto dst = rng.takeWhile_i([](int /*it*/, int idx){return idx > 0;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange_i, OneToZeroByItemValue) TEST(TakeWhileRange_i, OneToZeroByItemValue)
...@@ -299,7 +299,7 @@ TEST(TakeWhileRange_i, OneToZeroByItemValue) ...@@ -299,7 +299,7 @@ TEST(TakeWhileRange_i, OneToZeroByItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile_i([](int it, int /*idx*/){return it < 5;}); auto dst = rng.takeWhile_i([](int it, int /*idx*/){return it < 5;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange_i, OneToZeroByIndexAndItemValue) TEST(TakeWhileRange_i, OneToZeroByIndexAndItemValue)
...@@ -309,7 +309,7 @@ TEST(TakeWhileRange_i, OneToZeroByIndexAndItemValue) ...@@ -309,7 +309,7 @@ TEST(TakeWhileRange_i, OneToZeroByIndexAndItemValue)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile_i([](int it, int idx){return idx == 0 && it > 5;}); auto dst = rng.takeWhile_i([](int it, int idx){return idx == 0 && it > 5;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange, ZeroToZero) TEST(TakeWhileRange, ZeroToZero)
...@@ -319,7 +319,7 @@ TEST(TakeWhileRange, ZeroToZero) ...@@ -319,7 +319,7 @@ TEST(TakeWhileRange, ZeroToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile([](int){return false;}); auto dst = rng.takeWhile([](int){return false;});
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
TEST(TakeWhileRange_i, ZeroToZero) TEST(TakeWhileRange_i, ZeroToZero)
...@@ -329,7 +329,7 @@ TEST(TakeWhileRange_i, ZeroToZero) ...@@ -329,7 +329,7 @@ TEST(TakeWhileRange_i, ZeroToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.takeWhile_i([](int /*it*/, int /*idx*/){return false;}); auto dst = rng.takeWhile_i([](int /*it*/, int /*idx*/){return false;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -27,7 +27,7 @@ TEST(UnbitsRange, OneByteHL) ...@@ -27,7 +27,7 @@ TEST(UnbitsRange, OneByteHL)
int ans[] = {0xAA}; int ans[] = {0xAA};
auto rng = from(src); auto rng = from(src);
auto dst = rng.unbits(HighToLow); auto dst = rng.unbits(BitsHighToLow);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -38,7 +38,7 @@ TEST(UnbitsRange, OneByteLH) ...@@ -38,7 +38,7 @@ TEST(UnbitsRange, OneByteLH)
int ans[] = {0xAA}; int ans[] = {0xAA};
auto rng = from(src); auto rng = from(src);
auto dst = rng.unbits(LowToHigh); auto dst = rng.unbits(BitsLowToHigh);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -27,7 +27,7 @@ TEST(UnbytesRange, OneIntFL) ...@@ -27,7 +27,7 @@ TEST(UnbytesRange, OneIntFL)
unsigned ans[] = {0xDDCCBBAA}; unsigned ans[] = {0xDDCCBBAA};
auto rng = from(src); auto rng = from(src);
auto dst = rng.unbytes<unsigned>(FirstToLast); auto dst = rng.unbytes<unsigned>(BytesFirstToLast);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -38,7 +38,7 @@ TEST(UnbytesRange, OneIntLF) ...@@ -38,7 +38,7 @@ TEST(UnbytesRange, OneIntLF)
unsigned ans[] = {0xAABBCCDD}; unsigned ans[] = {0xAABBCCDD};
auto rng = from(src); auto rng = from(src);
auto dst = rng.unbytes<unsigned>(LastToFirst); auto dst = rng.unbytes<unsigned>(BytesLastToFirst);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -70,7 +70,7 @@ TEST(UnbytesRange, TwoIntsFL) ...@@ -70,7 +70,7 @@ TEST(UnbytesRange, TwoIntsFL)
unsigned ans[] = {0x12345678,0xDDCCBBAA}; unsigned ans[] = {0x12345678,0xDDCCBBAA};
auto rng = from(src); auto rng = from(src);
auto dst = rng.unbytes<unsigned>(FirstToLast); auto dst = rng.unbytes<unsigned>(BytesFirstToLast);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -85,7 +85,7 @@ TEST(UnbytesRange, TwoIntsLF) ...@@ -85,7 +85,7 @@ TEST(UnbytesRange, TwoIntsLF)
unsigned ans[] = {0x78563412,0xAABBCCDD}; unsigned ans[] = {0x78563412,0xAABBCCDD};
auto rng = from(src); auto rng = from(src);
auto dst = rng.unbytes<unsigned>(LastToFirst); auto dst = rng.unbytes<unsigned>(BytesLastToFirst);
CheckRangeEqArray(dst, ans); CheckRangeEqArray(dst, ans);
} }
...@@ -99,5 +99,5 @@ TEST(UnbytesRange, EmptyDefault) ...@@ -99,5 +99,5 @@ TEST(UnbytesRange, EmptyDefault)
auto rng = from(src); auto rng = from(src);
auto dst = rng.unbytes<int>(); auto dst = rng.unbytes<int>();
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
...@@ -108,7 +108,7 @@ TEST(WhereRange, ManyToZero) ...@@ -108,7 +108,7 @@ TEST(WhereRange, ManyToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.where([](int a){return a == 5;}); auto dst = rng.where([](int a){return a == 5;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(WhereRange, OneToZero) TEST(WhereRange, OneToZero)
...@@ -118,7 +118,7 @@ TEST(WhereRange, OneToZero) ...@@ -118,7 +118,7 @@ TEST(WhereRange, OneToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.where( [](int a){return a>10;}); auto dst = rng.where( [](int a){return a>10;});
EXPECT_THROW(dst.nextObject(), EnumeratorEndException); EXPECT_THROW(dst.nextObject(), LinqEndException);
} }
TEST(WhereRange, ZeroToZero) TEST(WhereRange, ZeroToZero)
...@@ -128,5 +128,5 @@ TEST(WhereRange, ZeroToZero) ...@@ -128,5 +128,5 @@ TEST(WhereRange, ZeroToZero)
auto rng = from(src); auto rng = from(src);
auto dst = rng.where( [](int a){return a>0;}); auto dst = rng.where( [](int a){return a>0;});
EXPECT_THROW(rng.nextObject(), EnumeratorEndException); EXPECT_THROW(rng.nextObject(), LinqEndException);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment