From 3d909981106454a9fe5ed4b27fd94f0135ef0871 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 6 Jun 2020 15:21:43 +0200 Subject: test stoul() --- tests/Makefile | 16 ---------------- tests/test-webserver.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 2f0e809..8529d6d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -26,12 +26,8 @@ TESTSRC=\ $(PROGSRC) build: $(PROJECTNAME) - +set -e ; for i in $(PLUGINS) ; do make -C plugins/$$i ; done ./$(PROJECTNAME) -all: build - ./webserver -c webserver.conf - $(PROJECTNAME): ../libcommon/libcommon.a $(TESTSRC:.cpp=.o) $(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@ @@ -43,18 +39,6 @@ dep: $(TESTSRC:.cpp=.d) %.o: %.cpp %.d $(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c $< -o $@ -install: - mkdir -p $(DESTDIR)/usr/bin - cp webserver $(DESTDIR)/usr/bin - - mkdir -p $(DESTDIR)/usr/lib/webserver/plugins - set -e ; for i in $(PLUGINS) ; do make -C plugins/$$i install ; done - - mkdir -p $(DESTDIR)/usr/local/lib/webserver/plugins - - #mkdir -p $(DESTDIR)/etc - #cp webserver.conf $(DESTDIR)/etc/webserver.conf - # misc --------------------------------------------------- clean: diff --git a/tests/test-webserver.cpp b/tests/test-webserver.cpp index f7020af..5838dfa 100644 --- a/tests/test-webserver.cpp +++ b/tests/test-webserver.cpp @@ -36,6 +36,13 @@ TEST(property_tree, put) EXPECT_EQ(ss.str(), "\nname1.txtname2.txt"); } +TEST(string, stoul) +{ + unsigned long l = std::stoul("-1"); + + EXPECT_EQ(l, std::numeric_limits::max()); +} + int main(int argc, char* argv[]) { ::testing::InitGoogleMock(&argc, argv); -- cgit v1.2.3