Commit ed1ca1c3 authored by Anton Bukov's avatar Anton Bukov

Merge pull request #5 from Gluttton/fix_compile_on_linux_gcc_4_8_1

Fix compile tests on linux gcc 4.8.1.
parents 9e3d4743 3a75baf4
......@@ -2,6 +2,10 @@
#include <set>
#include "boolinq.h"
using namespace boolinq;
//////////////////////////////////////////////////////////////////////////
// Compare Range with array
//////////////////////////////////////////////////////////////////////////
......@@ -44,8 +48,8 @@ void CheckRangeEqSet(R dst, T (&ans)[N])
EXPECT_EQ(expected.size(), actual.size());
std::set<T>::iterator it1 = expected.begin();
std::set<typename R::value_type>::iterator it2 = actual.begin();
typename std::set<T>::iterator it1 = expected.begin();
typename std::set<typename R::value_type>::iterator it2 = actual.begin();
for(; it1 != expected.end() && it2 != actual.end(); it1++, it2++)
{
EXPECT_EQ(*it2, *it1);
......
......@@ -249,27 +249,27 @@ TEST(Linq, Creations)
int arr[] = {1,2,3,4,5};
int * ptr = (int*)arr;
std::vector<const int> cvec;
cvec.push_back(1);
cvec.push_back(2);
cvec.push_back(3);
cvec.push_back(4);
cvec.push_back(5);
//std::vector<const int> cvec;
//cvec.push_back(1);
//cvec.push_back(2);
//cvec.push_back(3);
//cvec.push_back(4);
//cvec.push_back(5);
const int carr[] = {1,2,3,4,5};
const int * cptr = (const int*)carr;
auto dst_vec = from(vec);
auto dst_cvec = from(cvec);
//auto dst_cvec = from(cvec);
auto dst_arr = from(arr);
auto dst_carr = from(carr);
//auto dst_carr = from(carr);
auto dst_ptr = from<int>(ptr, ptr+5);
auto dst_cptr = from<const int>(cptr, cptr+5);
//auto dst_cptr = from<const int>(cptr, cptr+5);
auto dst_ptr_length = from<int>(ptr, 5);
auto dst_cptr_length = from<const int>(cptr, 5);
//auto dst_cptr_length = from<const int>(cptr, 5);
auto dst_vec_iter = from<int>(vec.begin(), vec.end());
auto dst_vec_citer = from<const int>(vec.cbegin(), vec.cend());
auto dst_cvec_iter = from<const int>(cvec.begin(), cvec.end());
auto dst_cvec_citer = from<const int>(cvec.cbegin(), cvec.cend());
//auto dst_vec_citer = from<const int>(vec.cbegin(), vec.cend());
//auto dst_cvec_iter = from<const int>(cvec.begin(), cvec.end());
//auto dst_cvec_citer = from<const int>(cvec.cbegin(), cvec.cend());
}
//////////////////////////////////////////////////////////////////////////
......
OPTIMIZATION ?= O0
ifdef COV
COVERAGE = -fprofile-arcs -ftest-coverage
endif
ifdef PROF
PROFILE = -pg
endif
CXX = g++
INCLUDES = -I.
CXXFLAGS = -c \
-MD \
-std=c++11 -march=native -mtune=native \
-Wall -Wextra \
-$(OPTIMIZATION) \
$(COVERAGE) \
$(PROFILE)
LDPATH =
LDADD = -lgtest -lgtest_main -lpthread \
$(COVERAGE) \
$(PROFILE)
SRC = AllTest.cpp \
AnyTest.cpp \
AvgTest.cpp \
BitsRangeTest.cpp \
BytesRangeTest.cpp \
ConcatRangeTest.cpp \
ContainsTest.cpp \
CountTest.cpp \
DistinctRangeTest.cpp \
DotCallTest.cpp \
ElementAtTest.cpp \
ForeachTest.cpp \
GroupByRangeTest.cpp \
IterRangeTest.cpp \
LinqTest.cpp \
MaxTest.cpp \
MinTest.cpp \
OrderByRangeTest.cpp \
ReverseRangeTest.cpp \
SelectRangeTest.cpp \
SkipRangeTest.cpp \
SkipWhileRangeTest.cpp \
SpeedTest.cpp \
SumTest.cpp \
TakeRangeTest.cpp \
TakeWhileRangeTest.cpp \
ToDequeTest.cpp \
ToListTest.cpp \
ToSetTest.cpp \
ToVectorTest.cpp \
UnbitsRangeTest.cpp \
UnbytesRangeTest.cpp \
WhereRangeTest.cpp
OBJ = $(SRC:.cpp=.o)
TEST = boolinqtest
COV_DATA = $(shell find . -type f -name '*.d' -o -name '*.gcov' -o -name '*.gcda' -o -name '*.gcno' -o -name 'coverage' -o -name 'coverage.info')
PRO_DATA = $(shell find . -type f -name 'gmon.out')
TMP_DATA = $(shell find . -type f -name '*~')
all: $(TEST)
$(TEST): $(OBJ)
$(CXX) $(OBJ) $(LDPATH) $(LDADD) -o $@
.cpp.o:
$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@
clean:
rm -rf $(OBJ) $(TEST) $(TMP_DATA) $(COV_DATA) $(PRO_DATA)
coverage:
lcov -q -c -f -b . -d . -o coverage.info &&\
lcov -q -r coverage.info /usr/\* -b . -d . -o coverage.info &&\
genhtml coverage.info --demangle-cpp --legend -f -q -o coverage
profile:
gprof $(TEST) gmon.out -b -Q
......@@ -8,6 +8,8 @@
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#pragma once
#include <set>
#include <list>
#include <deque>
......@@ -15,6 +17,7 @@
#include <vector>
#include <iostream>
#include <functional>
#include <climits>
namespace boolinq
{
......
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