diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-06-06 15:21:43 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-06-06 15:21:43 +0200 |
commit | 3d909981106454a9fe5ed4b27fd94f0135ef0871 (patch) | |
tree | 1c4a488cfb26248793d21c96d73d2adc2cbf4af3 | |
parent | 357cf76409d30341a2c4eedcf2568f0abd56e88d (diff) |
test stoul()
-rw-r--r-- | tests/Makefile | 16 | ||||
-rw-r--r-- | 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(), "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<list><listentry type=\"file1\">name1.txt</listentry><listentry type=\"file2\">name2.txt</listentry></list>"); } +TEST(string, stoul) +{ + unsigned long l = std::stoul("-1"); + + EXPECT_EQ(l, std::numeric_limits<unsigned long>::max()); +} + int main(int argc, char* argv[]) { ::testing::InitGoogleMock(&argc, argv); |