forked from ifsmirnov/jngen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
315 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "jngen.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CXXFLAGS = -O2 -Wall -Wextra -Werror -std=c++11 | ||
CXXFLAGS += -DJNGEN_DECLARE_ONLY | ||
LDFLAGS += -lboost_system -lboost_unit_test_framework | ||
|
||
CXX = g++-4.9 | ||
|
||
.PHONY: clean run | ||
|
||
run: main | ||
./main | ||
|
||
../lib.o: ../jngen.h ../lib.cpp | ||
cd .. && $(CXX) $(CXXFLAGS) -UJNGEN_DECLARE_ONLY lib.cpp -c | ||
|
||
%.o: %.cpp ../jngen.h | ||
$(CXX) $(CXXFLAGS) $< -c | ||
|
||
main: $(subst .cpp,.o,$(wildcard *.cpp)) ../lib.o | ||
$(info $^) | ||
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@ | ||
|
||
clean: | ||
rm -rf -- main *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#define BOOST_TEST_DYN_LINK | ||
#define BOOST_TEST_MAIN | ||
#include <boost/test/unit_test.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#define BOOST_TEST_DYN_LINK | ||
#include <boost/test/unit_test.hpp> | ||
#include "../jngen.h" | ||
|
||
#include <algorithm> | ||
#include <utility> | ||
|
||
BOOST_AUTO_TEST_SUITE(rnds_suite) | ||
|
||
BOOST_AUTO_TEST_CASE(basics) { | ||
rnd.seed(123); | ||
|
||
BOOST_CHECK_EQUAL(rnds.abacaba(10), "abacabadab"); | ||
BOOST_CHECK_EQUAL(rnds.abacaba(10, 'A'), "ABACABADAB"); | ||
|
||
BOOST_CHECK_EQUAL(rnds.thueMorse(10), "abbabaabba"); | ||
BOOST_CHECK_EQUAL(rnds.thueMorse(10, 'q', 'w'), "qwwqwqqwwq"); | ||
} | ||
|
||
BOOST_AUTO_TEST_SUITE_END() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters