move textspr/sprout/* -> libs/<libname>/test/*

fix binomial_distribution
This commit is contained in:
bolero-MURAKAMI 2012-05-19 18:46:38 +09:00
parent 237ec76266
commit 0ceabb5b9b
107 changed files with 1228 additions and 840 deletions

View file

@ -1,99 +1,99 @@
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/algorithm/transform.hpp>
#include <sprout/array.hpp>
#include <sprout/string.hpp>
#include <sprout/numeric/iota.hpp>
#include <sprout/pit.hpp>
#include <iostream>
struct fizzbuzz{
typedef sprout::string<12> result_type;
constexpr result_type
operator ()(int n) const{
return n % 15 == 0 ? sprout::to_string("FizzBuzz")
: n % 3 == 0 ? sprout::to_string("Fizz")
: n % 5 == 0 ? sprout::to_string("Buzz")
: sprout::to_string(n);
}
};
int
main(){
typedef fizzbuzz::result_type string;
//
// Test
//
static_assert(fizzbuzz()( 1) == "1", "");
static_assert(fizzbuzz()( 2) == "2", "");
static_assert(fizzbuzz()( 3) == "Fizz", "");
static_assert(fizzbuzz()( 5) == "Buzz", "");
static_assert(fizzbuzz()(15) == "FizzBuzz", "");
//
// Sequence [1..15]
//
constexpr auto source = sprout::iota(
sprout::pit<sprout::array<int, 15> >(),
1
);
//
// Transform to FizzBuzz
//
constexpr auto result = sprout::transform(
sprout::begin(source),
sprout::end(source),
sprout::pit<sprout::array<string, 15> >(),
fizzbuzz()
);
//
// Check result
//
constexpr auto fizzbuzz_result = sprout::make_array<string>(
sprout::to_string("1"),
sprout::to_string("2"),
sprout::to_string("Fizz"),
sprout::to_string("4"),
sprout::to_string("Buzz"),
sprout::to_string("Fizz"),
sprout::to_string("7"),
sprout::to_string("8"),
sprout::to_string("Fizz"),
sprout::to_string("Buzz"),
sprout::to_string("11"),
sprout::to_string("Fizz"),
sprout::to_string("13"),
sprout::to_string("14"),
sprout::to_string("FizzBuzz")
);
// Equal result sequence
static_assert(result == fizzbuzz_result, "");
//
// Output
//
for(auto&& str : result){
std::cout << str << ", ";
}
std::cout << std::endl;
return 0;
}
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/algorithm/transform.hpp>
#include <sprout/array.hpp>
#include <sprout/string.hpp>
#include <sprout/numeric/iota.hpp>
#include <sprout/pit.hpp>
#include <iostream>
struct fizzbuzz{
typedef sprout::string<12> result_type;
constexpr result_type
operator ()(int n) const{
return n % 15 == 0 ? sprout::to_string("FizzBuzz")
: n % 3 == 0 ? sprout::to_string("Fizz")
: n % 5 == 0 ? sprout::to_string("Buzz")
: sprout::to_string(n);
}
};
int
main(){
typedef fizzbuzz::result_type string;
//
// Test
//
static_assert(fizzbuzz()( 1) == "1", "");
static_assert(fizzbuzz()( 2) == "2", "");
static_assert(fizzbuzz()( 3) == "Fizz", "");
static_assert(fizzbuzz()( 5) == "Buzz", "");
static_assert(fizzbuzz()(15) == "FizzBuzz", "");
//
// Sequence [1..15]
//
constexpr auto source = sprout::iota(
sprout::pit<sprout::array<int, 15> >(),
1
);
//
// Transform to FizzBuzz
//
constexpr auto result = sprout::transform(
sprout::begin(source),
sprout::end(source),
sprout::pit<sprout::array<string, 15> >(),
fizzbuzz()
);
//
// Check result
//
constexpr auto fizzbuzz_result = sprout::make_array<string>(
sprout::to_string("1"),
sprout::to_string("2"),
sprout::to_string("Fizz"),
sprout::to_string("4"),
sprout::to_string("Buzz"),
sprout::to_string("Fizz"),
sprout::to_string("7"),
sprout::to_string("8"),
sprout::to_string("Fizz"),
sprout::to_string("Buzz"),
sprout::to_string("11"),
sprout::to_string("Fizz"),
sprout::to_string("13"),
sprout::to_string("14"),
sprout::to_string("FizzBuzz")
);
// Equal result sequence
static_assert(result == fizzbuzz_result, "");
//
// Output
//
for(auto&& str : result){
std::cout << str << ", ";
}
std::cout << std::endl;
return 0;
}

View file

@ -0,0 +1,26 @@
#ifndef SPROUT_LIBS_ALGORITHM_TEST_ALGORITHM_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_ALGORITHM_CPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_CPP_INCLUDE_DISABLE_SPROUT_LIBS_ALGORITHM_TEST_ALGORITHM_CPP
# define TESTSPR_CPP_INCLUDE
#endif
#include "./modifying.cpp"
#ifdef TESTSPR_CPP_INCLUDE_DISABLE_SPROUT_LIBS_ALGORITHM_TEST_ALGORITHM_CPP
# undef TESTSPR_CPP_INCLUDE
#endif
namespace testspr {
static void algorithm_test() {
testspr::algorithm_modifying_test();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_ALGORITHM_CPP

View file

@ -1,7 +1,7 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_BOGO_SORT_HPP
#define TESTSPR_SPROUT_ALGORITHM_BOGO_SORT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_BOGO_SORT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_BOGO_SORT_CPP
#include <sprout/algorithm/sort.hpp>
#include <sprout/algorithm/bogo_sort.hpp>
#include <sprout/random.hpp>
#include <sprout/random/unique_seed.hpp>
#include <sprout/array.hpp>
@ -129,5 +129,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_BOGO_SORT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_bogo_sort_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_BOGO_SORT_CPP

View file

@ -1,7 +1,7 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_BOGO_SORT_RESULT_HPP
#define TESTSPR_SPROUT_ALGORITHM_BOGO_SORT_RESULT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_BOGO_SORT_RESULT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_BOGO_SORT_RESULT_CPP
#include <sprout/algorithm/sort.hpp>
#include <sprout/algorithm/bogo_sort_result.hpp>
#include <sprout/random.hpp>
#include <sprout/random/unique_seed.hpp>
#include <sprout/array.hpp>
@ -171,5 +171,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_BOGO_SORT_RESULT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_bogo_sort_result_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_BOGO_SORT_RESULT_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_COPY_CPP
#include <sprout/algorithm/copy.hpp>
#include <sprout/array.hpp>
@ -98,5 +98,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_COPY_BACKWARD_HPP
#define TESTSPR_SPROUT_ALGORITHM_COPY_BACKWARD_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_BACKWARD_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_COPY_BACKWARD_CPP
#include <sprout/algorithm/copy_backward.hpp>
#include <sprout/array.hpp>
@ -98,5 +98,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_COPY_BACKWARD_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_copy_backward_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_BACKWARD_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_COPY_IF_HPP
#define TESTSPR_SPROUT_ALGORITHM_COPY_IF_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_IF_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_COPY_IF_CPP
#include <sprout/algorithm/copy_if.hpp>
#include <sprout/array.hpp>
@ -104,5 +104,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_COPY_IF_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_copy_if_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_IF_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_COPY_N_HPP
#define TESTSPR_SPROUT_ALGORITHM_COPY_N_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_N_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_COPY_N_CPP
#include <sprout/algorithm/copy_n.hpp>
#include <sprout/array.hpp>
@ -98,5 +98,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_COPY_N_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_copy_n_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_COPY_N_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_FILL_HPP
#define TESTSPR_SPROUT_ALGORITHM_FILL_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_FILL_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_FILL_CPP
#include <sprout/algorithm/fill.hpp>
#include <sprout/array.hpp>
@ -68,5 +68,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_FILL_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_fill_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_FILL_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_FILL_N_HPP
#define TESTSPR_SPROUT_ALGORITHM_FILL_N_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_FILL_N_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_FILL_N_CPP
#include <sprout/algorithm/fill_n.hpp>
#include <sprout/array.hpp>
@ -72,5 +72,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_FILL_N_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_fill_n_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_FILL_N_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_GENERATE_HPP
#define TESTSPR_SPROUT_ALGORITHM_GENERATE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_GENERATE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_GENERATE_CPP
#include <sprout/algorithm/generate.hpp>
#include <sprout/array.hpp>
@ -72,5 +72,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_GENERATE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_generate_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_GENERATE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_GENERATE_N_HPP
#define TESTSPR_SPROUT_ALGORITHM_GENERATE_N_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_GENERATE_N_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_GENERATE_N_CPP
#include <sprout/algorithm/generate_n.hpp>
#include <sprout/array.hpp>
@ -76,5 +76,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_GENERATE_N_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_generate_n_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_GENERATE_N_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_INPLACE_MERGE_HPP
#define TESTSPR_SPROUT_ALGORITHM_INPLACE_MERGE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_INPLACE_MERGE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_INPLACE_MERGE_CPP
#include <sprout/algorithm/inplace_merge.hpp>
#include <sprout/array.hpp>
@ -127,5 +127,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_INPLACE_MERGE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_inplace_merge_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_INPLACE_MERGE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_MAKE_HEAP_HPP
#define TESTSPR_SPROUT_ALGORITHM_MAKE_HEAP_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_MAKE_HEAP_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_MAKE_HEAP_CPP
#include <sprout/algorithm/make_heap.hpp>
#include <sprout/array.hpp>
@ -119,5 +119,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_MAKE_HEAP_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_make_heap_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_MAKE_HEAP_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_MAKE_PARTIAL_HEAP_HPP
#define TESTSPR_SPROUT_ALGORITHM_MAKE_PARTIAL_HEAP_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_MAKE_PARTIAL_HEAP_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_MAKE_PARTIAL_HEAP_CPP
#include <sprout/algorithm/make_partial_heap.hpp>
#include <sprout/array.hpp>
@ -127,5 +127,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_MAKE_PARTIAL_HEAP_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_make_partial_heap_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_MAKE_PARTIAL_HEAP_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_MERGE_HPP
#define TESTSPR_SPROUT_ALGORITHM_MERGE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_MERGE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_MERGE_CPP
#include <sprout/algorithm/merge.hpp>
#include <sprout/array.hpp>
@ -215,5 +215,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_MERGE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_merge_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_MERGE_CPP

View file

@ -0,0 +1,120 @@
#ifndef SPROUT_LIBS_ALGORITHM_TEST_MODIFYIING_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_MODIFYIING_CPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_CPP_INCLUDE_DISABLE_SPROUT_LIBS_ALGORITHM_TEST_MODIFYIING_CPP
# define TESTSPR_CPP_INCLUDE
#endif
#include "./copy.cpp"
#include "./copy_n.cpp"
#include "./copy_if.cpp"
#include "./copy_backward.cpp"
#include "./transform.cpp"
#include "./replace.cpp"
#include "./replace_if.cpp"
#include "./replace_copy.cpp"
#include "./replace_copy_if.cpp"
#include "./fill.cpp"
#include "./fill_n.cpp"
#include "./generate.cpp"
#include "./generate_n.cpp"
#include "./remove.cpp"
#include "./remove_if.cpp"
#include "./remove_copy.cpp"
#include "./remove_copy_if.cpp"
#include "./unique.cpp"
#include "./unique_copy.cpp"
#include "./reverse.cpp"
#include "./reverse_copy.cpp"
#include "./rotate.cpp"
#include "./rotate_copy.cpp"
#include "./shuffle.cpp"
#include "./shuffle_result.cpp"
#include "./partition.cpp"
#include "./partition_copy.cpp"
#include "./stable_partition.cpp"
#include "./stable_partition_copy.cpp"
#include "./sort.cpp"
#include "./stable_sort.cpp"
#include "./partial_sort.cpp"
#include "./nth_element.cpp"
#include "./merge.cpp"
#include "./inplace_merge.cpp"
#include "./set_union.cpp"
#include "./set_intersection.cpp"
#include "./set_difference.cpp"
#include "./set_symmetric_difference.cpp"
#include "./push_heap.cpp"
#include "./pop_heap.cpp"
#include "./make_heap.cpp"
#include "./make_partial_heap.cpp"
#include "./sort_heap.cpp"
#include "./swap_element.cpp"
#include "./swap_element_copy.cpp"
#include "./bogo_sort.cpp"
#include "./bogo_sort_result.cpp"
#ifdef TESTSPR_CPP_INCLUDE_DISABLE_SPROUT_LIBS_ALGORITHM_TEST_MODIFYIING_CPP
# undef TESTSPR_CPP_INCLUDE
#endif
namespace testspr {
static void algorithm_modifying_test() {
testspr::algorithm_copy_test();
testspr::algorithm_copy_n_test();
testspr::algorithm_copy_if_test();
testspr::algorithm_copy_backward_test();
testspr::algorithm_transform_test();
testspr::algorithm_replace_test();
testspr::algorithm_replace_if_test();
testspr::algorithm_replace_copy_test();
testspr::algorithm_replace_copy_if_test();
testspr::algorithm_fill_test();
testspr::algorithm_fill_n_test();
testspr::algorithm_generate_test();
testspr::algorithm_generate_n_test();
testspr::algorithm_remove_test();
testspr::algorithm_remove_if_test();
testspr::algorithm_remove_copy_test();
testspr::algorithm_remove_copy_if_test();
testspr::algorithm_unique_test();
testspr::algorithm_unique_copy_test();
testspr::algorithm_reverse_test();
testspr::algorithm_reverse_copy_test();
testspr::algorithm_rotate_test();
testspr::algorithm_rotate_copy_test();
testspr::algorithm_shuffle_test();
testspr::algorithm_shuffle_result_test();
testspr::algorithm_partition_test();
testspr::algorithm_partition_copy_test();
testspr::algorithm_stable_partition_test();
testspr::algorithm_stable_partition_copy_test();
testspr::algorithm_sort_test();
testspr::algorithm_stable_sort_test();
testspr::algorithm_partial_sort_test();
testspr::algorithm_nth_element_test();
testspr::algorithm_merge_test();
testspr::algorithm_inplace_merge_test();
testspr::algorithm_set_union_test();
testspr::algorithm_set_intersection_test();
testspr::algorithm_set_difference_test();
testspr::algorithm_set_symmetric_difference_test();
testspr::algorithm_push_heap_test();
testspr::algorithm_pop_heap_test();
testspr::algorithm_make_heap_test();
testspr::algorithm_make_partial_heap_test();
testspr::algorithm_sort_heap_test();
testspr::algorithm_swap_element_test();
testspr::algorithm_swap_element_copy_test();
testspr::algorithm_bogo_sort_test();
testspr::algorithm_bogo_sort_result_test();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_modifying_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_MODIFYIING_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_NTH_ELEMENT_HPP
#define TESTSPR_SPROUT_ALGORITHM_NTH_ELEMENT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_NTH_ELEMENT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_NTH_ELEMENT_CPP
#include <sprout/algorithm/nth_element.hpp>
#include <sprout/array.hpp>
@ -127,5 +127,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_NTH_ELEMENT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_nth_element_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_NTH_ELEMENT_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_PARTIAL_SORT_HPP
#define TESTSPR_SPROUT_ALGORITHM_PARTIAL_SORT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_PARTIAL_SORT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_PARTIAL_SORT_CPP
#include <sprout/algorithm/partial_sort.hpp>
#include <sprout/array.hpp>
@ -127,5 +127,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_PARTIAL_SORT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_partial_sort_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_PARTIAL_SORT_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_PARTITION_HPP
#define TESTSPR_SPROUT_ALGORITHM_PARTITION_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_PARTITION_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_PARTITION_CPP
#include <sprout/algorithm/partition.hpp>
#include <sprout/array.hpp>
@ -68,5 +68,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_PARTITION_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_partition_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_PARTITION_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_PARTITION_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_PARTITION_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_PARTITION_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_PARTITION_COPY_CPP
#include <sprout/algorithm/partition_copy.hpp>
#include <sprout/array.hpp>
@ -104,5 +104,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_PARTITION_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_partition_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_PARTITION_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_POP_HEAP_HPP
#define TESTSPR_SPROUT_ALGORITHM_POP_HEAP_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_POP_HEAP_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_POP_HEAP_CPP
#include <sprout/algorithm/pop_heap.hpp>
#include <sprout/array.hpp>
@ -64,5 +64,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_POP_HEAP_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_pop_heap_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_POP_HEAP_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_PUSH_HEAP_HPP
#define TESTSPR_SPROUT_ALGORITHM_PUSH_HEAP_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_PUSH_HEAP_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_PUSH_HEAP_CPP
#include <sprout/algorithm/push_heap.hpp>
#include <sprout/array.hpp>
@ -119,5 +119,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_PUSH_HEAP_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_push_heap_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_PUSH_HEAP_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_HPP
#define TESTSPR_SPROUT_ALGORITHM_REMOVE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REMOVE_CPP
#include <sprout/algorithm/remove.hpp>
#include <sprout/array.hpp>
@ -68,5 +68,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_remove_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_REMOVE_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REMOVE_COPY_CPP
#include <sprout/algorithm/remove_copy.hpp>
#include <sprout/array.hpp>
@ -104,5 +104,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_remove_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_COPY_IF_HPP
#define TESTSPR_SPROUT_ALGORITHM_REMOVE_COPY_IF_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_COPY_IF_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REMOVE_COPY_IF_CPP
#include <sprout/algorithm/remove_copy_if.hpp>
#include <sprout/array.hpp>
@ -104,5 +104,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_COPY_IF_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_remove_copy_if_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_COPY_IF_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_IF_HPP
#define TESTSPR_SPROUT_ALGORITHM_REMOVE_IF_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_IF_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REMOVE_IF_CPP
#include <sprout/algorithm/remove_if.hpp>
#include <sprout/array.hpp>
@ -68,5 +68,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REMOVE_IF_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_remove_if_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REMOVE_IF_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_HPP
#define TESTSPR_SPROUT_ALGORITHM_REPLACE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REPLACE_CPP
#include <sprout/algorithm/replace.hpp>
#include <sprout/array.hpp>
@ -72,5 +72,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_replace_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_REPLACE_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REPLACE_COPY_CPP
#include <sprout/algorithm/replace_copy.hpp>
#include <sprout/array.hpp>
@ -110,5 +110,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_replace_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_COPY_IF_HPP
#define TESTSPR_SPROUT_ALGORITHM_REPLACE_COPY_IF_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_COPY_IF_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REPLACE_COPY_IF_CPP
#include <sprout/algorithm/replace_copy_if.hpp>
#include <sprout/array.hpp>
@ -110,5 +110,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_COPY_IF_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_replace_copy_if_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_COPY_IF_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_IF_HPP
#define TESTSPR_SPROUT_ALGORITHM_REPLACE_IF_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_IF_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REPLACE_IF_CPP
#include <sprout/algorithm/replace_if.hpp>
#include <sprout/array.hpp>
@ -72,5 +72,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REPLACE_IF_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_replace_if_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REPLACE_IF_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REBERSE_HPP
#define TESTSPR_SPROUT_ALGORITHM_REBERSE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REBERSE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REBERSE_CPP
#include <sprout/algorithm/reverse.hpp>
#include <sprout/array.hpp>
@ -64,5 +64,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REBERSE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_reverse_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REBERSE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_REBERSE_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_REBERSE_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_REBERSE_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_REBERSE_COPY_CPP
#include <sprout/algorithm/reverse_copy.hpp>
#include <sprout/array.hpp>
@ -98,5 +98,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_REBERSE_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_reverse_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_REBERSE_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_ROTATE_HPP
#define TESTSPR_SPROUT_ALGORITHM_ROTATE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_ROTATE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_ROTATE_CPP
#include <sprout/algorithm/rotate.hpp>
#include <sprout/array.hpp>
@ -68,5 +68,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_ROTATE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_rotate_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_ROTATE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_ROTATE_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_ROTATE_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_ROTATE_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_ROTATE_COPY_CPP
#include <sprout/algorithm/rotate_copy.hpp>
#include <sprout/array.hpp>
@ -104,5 +104,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_ROTATE_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_rotate_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_ROTATE_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SET_DIFFERENCE_HPP
#define TESTSPR_SPROUT_ALGORITHM_SET_DIFFERENCE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_DIFFERENCE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SET_DIFFERENCE_CPP
#include <sprout/algorithm/set_difference.hpp>
#include <sprout/array.hpp>
@ -215,5 +215,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SET_DIFFERENCE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_set_difference_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_DIFFERENCE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SET_INTERSECTION_HPP
#define TESTSPR_SPROUT_ALGORITHM_SET_INTERSECTION_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_INTERSECTION_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SET_INTERSECTION_CPP
#include <sprout/algorithm/set_intersection.hpp>
#include <sprout/array.hpp>
@ -215,5 +215,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SET_INTERSECTION_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_set_intersection_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_INTERSECTION_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SET_SYMMETRIC_DIFFERENCE_HPP
#define TESTSPR_SPROUT_ALGORITHM_SET_SYMMETRIC_DIFFERENCE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_SYMMETRIC_DIFFERENCE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SET_SYMMETRIC_DIFFERENCE_CPP
#include <sprout/algorithm/set_symmetric_difference.hpp>
#include <sprout/array.hpp>
@ -215,5 +215,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SET_SYMMETRIC_DIFFERENCE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_set_symmetric_difference_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_SYMMETRIC_DIFFERENCE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SET_UNION_HPP
#define TESTSPR_SPROUT_ALGORITHM_SET_UNION_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_UNION_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SET_UNION_CPP
#include <sprout/algorithm/set_union.hpp>
#include <sprout/array.hpp>
@ -215,5 +215,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SET_UNION_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_set_union_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SET_UNION_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SHUFFLE_HPP
#define TESTSPR_SPROUT_ALGORITHM_SHUFFLE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SHUFFLE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SHUFFLE_CPP
#include <sprout/algorithm/shuffle.hpp>
#include <sprout/random.hpp>
@ -70,5 +70,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SHUFFLE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_shuffle_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SHUFFLE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SHUFFLE_RESULT_HPP
#define TESTSPR_SPROUT_ALGORITHM_SHUFFLE_RESULT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SHUFFLE_RESULT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SHUFFLE_RESULT_CPP
#include <sprout/algorithm/shuffle_result.hpp>
#include <sprout/random.hpp>
@ -91,5 +91,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SHUFFLE_RESULT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_shuffle_result_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SHUFFLE_RESULT_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SORT_HPP
#define TESTSPR_SPROUT_ALGORITHM_SORT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SORT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SORT_CPP
#include <sprout/algorithm/sort.hpp>
#include <sprout/array.hpp>
@ -119,5 +119,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SORT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_sort_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SORT_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SORT_HEAP_HPP
#define TESTSPR_SPROUT_ALGORITHM_SORT_HEAP_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SORT_HEAP_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SORT_HEAP_CPP
#include <sprout/algorithm/sort_heap.hpp>
#include <sprout/array.hpp>
@ -119,5 +119,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SORT_HEAP_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_sort_heap_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SORT_HEAP_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_STABLE_PARTITION_HPP
#define TESTSPR_SPROUT_ALGORITHM_STABLE_PARTITION_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_STABLE_PARTITION_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_STABLE_PARTITION_CPP
#include <sprout/algorithm/stable_partition.hpp>
#include <sprout/array.hpp>
@ -68,5 +68,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_STABLE_PARTITION_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_stable_partition_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_STABLE_PARTITION_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_STABLE_PARTITION_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_STABLE_PARTITION_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_STABLE_PARTITION_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_STABLE_PARTITION_COPY_CPP
#include <sprout/algorithm/stable_partition_copy.hpp>
#include <sprout/array.hpp>
@ -104,5 +104,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_STABLE_PARTITION_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_stable_partition_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_STABLE_PARTITION_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_STABLE_SORT_HPP
#define TESTSPR_SPROUT_ALGORITHM_STABLE_SORT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_STABLE_SORT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_STABLE_SORT_CPP
#include <sprout/algorithm/stable_sort.hpp>
#include <sprout/array.hpp>
@ -119,5 +119,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_STABLE_SORT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_stable_sort_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_STABLE_SORT_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SWAP_ELEMENT_HPP
#define TESTSPR_SPROUT_ALGORITHM_SWAP_ELEMENT_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SWAP_ELEMENT_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SWAP_ELEMENT_CPP
#include <sprout/algorithm/swap_element.hpp>
#include <sprout/array.hpp>
@ -72,5 +72,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SWAP_ELEMENT_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_swap_element_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SWAP_ELEMENT_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_SWAP_ELEMENT_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_SWAP_ELEMENT_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_SWAP_ELEMENT_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_SWAP_ELEMENT_COPY_CPP
#include <sprout/algorithm/swap_element_copy.hpp>
#include <sprout/array.hpp>
@ -110,5 +110,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_SWAP_ELEMENT_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_swap_element_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_SWAP_ELEMENT_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_TRANSFORM_HPP
#define TESTSPR_SPROUT_ALGORITHM_TRANSFORM_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_TRANSFORM_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_TRANSFORM_CPP
#include <sprout/algorithm/transform.hpp>
#include <sprout/array.hpp>
@ -202,5 +202,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_TRANSFORM_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_transform_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_TRANSFORM_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_UNIQUE_HPP
#define TESTSPR_SPROUT_ALGORITHM_UNIQUE_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_UNIQUE_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_UNIQUE_CPP
#include <sprout/algorithm/unique.hpp>
#include <sprout/array.hpp>
@ -119,5 +119,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_UNIQUE_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_unique_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_UNIQUE_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_UNIQUE_COPY_HPP
#define TESTSPR_SPROUT_ALGORITHM_UNIQUE_COPY_HPP
#ifndef SPROUT_LIBS_ALGORITHM_TEST_UNIQUE_COPY_CPP
#define SPROUT_LIBS_ALGORITHM_TEST_UNIQUE_COPY_CPP
#include <sprout/algorithm/unique_copy.hpp>
#include <sprout/array.hpp>
@ -189,5 +189,10 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_UNIQUE_COPY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::algorithm_unique_copy_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ALGORITHM_TEST_UNIQUE_COPY_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_ARRAY_HPP
#define TESTSPR_SPROUT_ARRAY_HPP
#ifndef SPROUT_LIBS_ARRAY_TEST_ARRAY_CPP
#define SPROUT_LIBS_ARRAY_TEST_ARRAY_CPP
#include <sprout/array.hpp>
#include <sprout/container.hpp>
@ -139,5 +139,9 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ARRAY_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::array_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_ARRAY_TEST_ARRAY_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_ADDITIVE_COMBINE_CPP
#define SPROUT_LIBS_RANDOM_TEST_ADDITIVE_COMBINE_CPP
#include <sprout/random/additive_combine.hpp>
#include "./engine_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_additive_combine_test() {
using namespace sprout;
testspr::random_engine_test_generic<sprout::random::ecuyer1988>();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_additive_combine_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_ADDITIVE_COMBINE_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_BERNOULLI_DISTRIBUTION_CPP
#define SPROUT_LIBS_RANDOM_TEST_BERNOULLI_DISTRIBUTION_CPP
#include <sprout/random/bernoulli_distribution.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_bernoulli_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::bernoulli_distribution<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_bernoulli_distribution_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_BERNOULLI_DISTRIBUTION_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_BINOMIAL_DISTRIBUTION_CPP
#define SPROUT_LIBS_RANDOM_TEST_BINOMIAL_DISTRIBUTION_CPP
#include <sprout/random/binomial_distribution.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_binomial_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::binomial_distribution<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_binomial_distribution_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_BINOMIAL_DISTRIBUTION_CPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_RANDOM_DISTRIBUTION_GENERIC_HPP
#define TESTSPR_SPROUT_RANDOM_DISTRIBUTION_GENERIC_HPP
#ifndef SPROUT_LIBS_RANDOM_TEST_DISTRIBUTION_GENERIC_HPP
#define SPROUT_LIBS_RANDOM_TEST_DISTRIBUTION_GENERIC_HPP
#include <string>
#include <sstream>
@ -79,4 +79,4 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_DISTRIBUTION_GENERIC_HPP
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_DISTRIBUTION_GENERIC_HPP

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_RANDOM_ENGINE_GENERIC_HPP
#define TESTSPR_SPROUT_RANDOM_ENGINE_GENERIC_HPP
#ifndef SPROUT_LIBS_RANDOM_TEST_ENGINE_GENERIC_HPP
#define SPROUT_LIBS_RANDOM_TEST_ENGINE_GENERIC_HPP
#include <string>
#include <sstream>
@ -68,4 +68,4 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_ENGINE_GENERIC_HPP
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_ENGINE_GENERIC_HPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_GEOMETRIC_DISTRIBUTION_CPP
#define SPROUT_LIBS_RANDOM_TEST_GEOMETRIC_DISTRIBUTION_CPP
#include <sprout/random/geometric_distribution.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_geometric_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::geometric_distribution<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_geometric_distribution_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_GEOMETRIC_DISTRIBUTION_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_INVERSIVE_CONGRUENTIAL_CPP
#define SPROUT_LIBS_RANDOM_TEST_INVERSIVE_CONGRUENTIAL_CPP
#include <sprout/random/linear_congruential.hpp>
#include "./engine_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_inversive_congruential_test() {
using namespace sprout;
testspr::random_engine_test_generic<sprout::random::hellekalek1995>();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_inversive_congruential_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_INVERSIVE_CONGRUENTIAL_CPP

View file

@ -1,8 +1,8 @@
#ifndef TESTSPR_SPROUT_RANDOM_LINEAR_CONGRUENTIAL_HPP
#define TESTSPR_SPROUT_RANDOM_LINEAR_CONGRUENTIAL_HPP
#ifndef SPROUT_LIBS_RANDOM_TEST_LINEAR_CONGRUENTIAL_CPP
#define SPROUT_LIBS_RANDOM_TEST_LINEAR_CONGRUENTIAL_CPP
#include <sprout/random/linear_congruential.hpp>
#include <testspr/sprout/random/engine_generic.hpp>
#include "./engine_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
@ -15,4 +15,9 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_LINEAR_CONGRUENTIAL_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_linear_congruential_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_LINEAR_CONGRUENTIAL_CPP

View file

@ -1,8 +1,8 @@
#ifndef TESTSPR_SPROUT_RANDOM_MERSENNE_TWISTER_HPP
#define TESTSPR_SPROUT_RANDOM_MERSENNE_TWISTER_HPP
#ifndef SPROUT_LIBS_RANDOM_TEST_MERSENNE_TWISTER_CPP
#define SPROUT_LIBS_RANDOM_TEST_MERSENNE_TWISTER_CPP
#include <sprout/random/mersenne_twister.hpp>
#include <testspr/sprout/random/engine_generic.hpp>
#include "./engine_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
@ -15,4 +15,9 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_MERSENNE_TWISTER_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_mersenne_twister_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_MERSENNE_TWISTER_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_NORMAL_DISTRIBUTION_CPP
#define SPROUT_LIBS_RANDOM_TEST_NORMAL_DISTRIBUTION_CPP
#include <sprout/random/normal_distribution.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_normal_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::normal_distribution<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_normal_distribution_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_NORMAL_DISTRIBUTION_CPP

View file

@ -0,0 +1,55 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_RANDOM_CPP
#define SPROUT_LIBS_RANDOM_TEST_RANDOM_CPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_CPP_INCLUDE_DISABLE_SPROUT_LIBS_RANDOM_TEST_RANDOM_CPP
# define TESTSPR_CPP_INCLUDE
#endif
#include "./linear_congruential.cpp"
#include "./additive_combine.cpp"
#include "./shuffle_order.cpp"
#include "./inversive_congruential.cpp"
#include "./taus88.cpp"
//#include "./mersenne_twister.cpp"
#include "./uniform_smallint.cpp"
#include "./uniform_int_distribution.cpp"
#include "./uniform_01.cpp"
#include "./uniform_real_distribution.cpp"
#include "./bernoulli_distribution.cpp"
#include "./binomial_distribution.cpp"
#include "./geometric_distribution.cpp"
#include "./normal_distribution.cpp"
#include <testspr/tools.hpp>
#ifdef TESTSPR_CPP_INCLUDE_DISABLE_SPROUT_LIBS_RANDOM_TEST_RANDOM_CPP
# undef TESTSPR_CPP_INCLUDE
#endif
namespace testspr {
void random_test() {
using namespace sprout;
testspr::random_linear_congruential_test();
testspr::random_additive_combine_test();
testspr::random_shuffle_order_test();
testspr::random_inversive_congruential_test();
testspr::random_taus88_test();
//testspr::random_mersenne_twister_test();
testspr::random_uniform_smallint_test();
testspr::random_uniform_int_distribution_test();
testspr::random_uniform_01_test();
testspr::random_uniform_real_distribution_test();
testspr::random_bernoulli_distribution_test();
testspr::random_binomial_distribution_test();
testspr::random_geometric_distribution_test();
testspr::random_normal_distribution_test();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_RANDOM_CPP

View file

@ -0,0 +1,22 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_SHUFFLE_ORDER_CPP
#define SPROUT_LIBS_RANDOM_TEST_SHUFFLE_ORDER_CPP
#include <sprout/random/shuffle_order.hpp>
#include "./engine_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_shuffle_order_test() {
using namespace sprout;
testspr::random_engine_test_generic<sprout::random::knuth_b>();
testspr::random_engine_test_generic<sprout::random::kreutzer1986>();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_shuffle_order_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_SHUFFLE_ORDER_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_TAUS88_CPP
#define SPROUT_LIBS_RANDOM_TEST_TAUS88_CPP
#include <sprout/random/taus88.hpp>
#include "./engine_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_taus88_test() {
using namespace sprout;
testspr::random_engine_test_generic<sprout::random::taus88>();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_taus88_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_TAUS88_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_01_CPP
#define SPROUT_LIBS_RANDOM_TEST_UNIFORM_01_CPP
#include <sprout/random/uniform_01.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_uniform_01_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::uniform_01<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_uniform_01_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_01_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_INT_DISTRIBUTION_CPP
#define SPROUT_LIBS_RANDOM_TEST_UNIFORM_INT_DISTRIBUTION_CPP
#include <sprout/random/uniform_int_distribution.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_uniform_int_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::uniform_int_distribution<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_uniform_int_distribution_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_INT_DISTRIBUTION_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_REAL_DISTRIBUTION_CPP
#define SPROUT_LIBS_RANDOM_TEST_UNIFORM_REAL_DISTRIBUTION_CPP
#include <sprout/random/uniform_real_distribution.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_uniform_real_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::uniform_real_distribution<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_uniform_real_distribution_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_REAL_DISTRIBUTION_CPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_SMALLINT_CPP
#define SPROUT_LIBS_RANDOM_TEST_UNIFORM_SMALLINT_CPP
#include <sprout/random/uniform_smallint.hpp>
#include "./distribution_generic.hpp"
#include <testspr/tools.hpp>
namespace testspr {
void random_uniform_smallint_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::uniform_smallint<> >();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::random_uniform_smallint_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_UNIFORM_SMALLINT_CPP

View file

@ -1,60 +1,60 @@
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/string.hpp>
int
main(){
//
// String literal to Sprout.String
//
{
static constexpr auto str1 = sprout::to_string("homu");
static_assert(str1 == "homu", "");
static_assert(std::is_same<decltype(str1), sprout::string<4> const>{}, "");
static constexpr auto str2 = sprout::to_string(L"ほむほむ");
static_assert(str2 == L"ほむほむ", "");
static_assert(std::is_same<decltype(str2), sprout::wstring<4> const>{}, "");
}
//
// Integer literal to Sprout.String
//
{
static constexpr auto str = sprout::to_string(42);
static_assert(str == "42", "");
}
//
// Float literal to Sprout.String
//
{
static constexpr auto str = sprout::to_string(3.14f);
static_assert(str == "3.140000", "");
}
//
// Char literal to Sprout.String
//
{
static constexpr auto str = sprout::make_string('m', 'a', 'd', 'o');
static_assert(str == "mado", "");
static_assert(std::is_same<decltype(str), sprout::string<4> const>{}, "");
}
return 0;
}
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/string.hpp>
int
main(){
//
// String literal to Sprout.String
//
{
static constexpr auto str1 = sprout::to_string("homu");
static_assert(str1 == "homu", "");
static_assert(std::is_same<decltype(str1), sprout::string<4> const>{}, "");
static constexpr auto str2 = sprout::to_string(L"ほむほむ");
static_assert(str2 == L"ほむほむ", "");
static_assert(std::is_same<decltype(str2), sprout::wstring<4> const>{}, "");
}
//
// Integer literal to Sprout.String
//
{
static constexpr auto str = sprout::to_string(42);
static_assert(str == "42", "");
}
//
// Float literal to Sprout.String
//
{
static constexpr auto str = sprout::to_string(3.14f);
static_assert(str == "3.140000", "");
}
//
// Char literal to Sprout.String
//
{
static constexpr auto str = sprout::make_string('m', 'a', 'd', 'o');
static_assert(str == "mado", "");
static_assert(std::is_same<decltype(str), sprout::string<4> const>{}, "");
}
return 0;
}

View file

@ -1,87 +1,87 @@
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/string.hpp>
#include <sstream>
#include <cassert>
//
// Sprout.String is constexpr string object
//
int
main(){
//
// String literal to Sprout.String
//
static constexpr sprout::string<4> str1 = sprout::to_string("homu");
static constexpr auto str2 = sprout::to_string("mado");
static constexpr auto str3 = sprout::to_string(42);
//
// Comparison
//
static_assert(str1 == sprout::to_string("homu"), "");
static_assert(str2 == "mado", "");
static_assert(str3 == "42", "");
static_assert(str1 != str2, "");
//
// Accessor
//
static_assert(str1.front() == 'h', "");
static_assert(str1[1] == 'o', "");
static_assert(str1.at(2) == 'm', "");
static_assert(str1.back() == 'u', "");
//
// String concatenation
//
static_assert((str1 + "homu") == "homuhomu", "");
static_assert((str1 + str2) == "homumado", "");
static_assert((str1 + sprout::to_string("42")) == "homu42", "");
//
// C style string
//
constexpr char const* cp = str1.c_str();
static_assert(cp[0] == 'h', "");
//
// Iterator
//
static_assert(*str1.begin() == 'h', "");
static_assert(*(str1.end() - 1) == 'u', "");
static_assert(*(str1.rbegin() + 1) == 'm', "");
static_assert(*(str1.rend() - 2) == 'o', "");
//
// IOStream
//
{
std::ostringstream os;
os << str1;
assert(os.str() == "homu");
}
{
std::istringstream is("mami");
sprout::string<4> str;
is >> str;
assert(str == "mami");
}
return 0;
}
//
// Sprout C++ Library
//
// Copyright (c) 2012
// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/
// osyo-manga : http://d.hatena.ne.jp/osyo-manga/
//
// Readme:
// https://github.com/osyo-manga/cpp-half/blob/master/README
//
// License:
// Boost Software License - Version 1.0
// <http://www.boost.org/LICENSE_1_0.txt>
//
#include <sprout/string.hpp>
#include <sstream>
#include <cassert>
//
// Sprout.String is constexpr string object
//
int
main(){
//
// String literal to Sprout.String
//
static constexpr sprout::string<4> str1 = sprout::to_string("homu");
static constexpr auto str2 = sprout::to_string("mado");
static constexpr auto str3 = sprout::to_string(42);
//
// Comparison
//
static_assert(str1 == sprout::to_string("homu"), "");
static_assert(str2 == "mado", "");
static_assert(str3 == "42", "");
static_assert(str1 != str2, "");
//
// Accessor
//
static_assert(str1.front() == 'h', "");
static_assert(str1[1] == 'o', "");
static_assert(str1.at(2) == 'm', "");
static_assert(str1.back() == 'u', "");
//
// String concatenation
//
static_assert((str1 + "homu") == "homuhomu", "");
static_assert((str1 + str2) == "homumado", "");
static_assert((str1 + sprout::to_string("42")) == "homu42", "");
//
// C style string
//
constexpr char const* cp = str1.c_str();
static_assert(cp[0] == 'h', "");
//
// Iterator
//
static_assert(*str1.begin() == 'h', "");
static_assert(*(str1.end() - 1) == 'u', "");
static_assert(*(str1.rbegin() + 1) == 'm', "");
static_assert(*(str1.rend() - 2) == 'o', "");
//
// IOStream
//
{
std::ostringstream os;
os << str1;
assert(os.str() == "homu");
}
{
std::istringstream is("mami");
sprout::string<4> str;
is >> str;
assert(str == "mami");
}
return 0;
}

View file

@ -1,5 +1,5 @@
#ifndef TESTSPR_SPROUT_STRING_HPP
#define TESTSPR_SPROUT_STRING_HPP
#ifndef SPROUT_LIBS_STRING_TEST_STRING_CPP
#define SPROUT_LIBS_STRING_TEST_STRING_CPP
#include <cstring>
#include <sstream>
@ -222,5 +222,9 @@ namespace testspr {
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_STRING_HPP
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::string_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef SPROUT_LIBS_STRING_TEST_STRING_CPP

View file

@ -293,7 +293,7 @@ namespace std {
// tuple_size
//
template<typename T, std::size_t N>
class tuple_size<sprout::array<T, N> >
struct tuple_size<sprout::array<T, N> >
: public std::integral_constant<std::size_t, N>
{};
@ -301,7 +301,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename T, std::size_t N>
class tuple_element<I, sprout::array<T, N> > {
struct tuple_element<I, sprout::array<T, N> > {
public:
static_assert(I < N, "tuple_element<>: index out of range");
typedef T type;

View file

@ -217,7 +217,7 @@ namespace std {
// tuple_size
//
template<typename Container>
class tuple_size<sprout::pit<Container> >
struct tuple_size<sprout::pit<Container> >
: public std::tuple_size<Container>
{};
@ -225,7 +225,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename Container>
class tuple_element<I, sprout::pit<Container> >
struct tuple_element<I, sprout::pit<Container> >
: public std::tuple_element<I, Container>
{};
} // namespace std

View file

@ -7,6 +7,7 @@
#include <stdexcept>
#include <sprout/config.hpp>
#include <sprout/array.hpp>
#include <sprout/cstdlib/abs.hpp>
#include <sprout/math/abs.hpp>
#include <sprout/math/log.hpp>
#include <sprout/math/pow.hpp>

View file

@ -11,7 +11,7 @@ namespace std {
// tuple_size
//
template<typename T, std::size_t N, typename Traits>
class tuple_size<sprout::basic_string<T, N, Traits> >
struct tuple_size<sprout::basic_string<T, N, Traits> >
: public std::integral_constant<std::size_t, N>
{};
@ -19,7 +19,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename T, std::size_t N, typename Traits>
class tuple_element<I, sprout::basic_string<T, N, Traits> > {
struct tuple_element<I, sprout::basic_string<T, N, Traits> > {
public:
static_assert(I < N, "tuple_element<>: index out of range");
typedef T type;

View file

@ -854,7 +854,7 @@ namespace std {
// tuple_size
//
template<typename Container>
class tuple_size<sprout::sub_array<Container> >
struct tuple_size<sprout::sub_array<Container> >
: public std::tuple_size<typename std::remove_reference<Container>::type>
{};
@ -862,7 +862,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename Container>
class tuple_element<I, sprout::sub_array<Container> >
struct tuple_element<I, sprout::sub_array<Container> >
: public std::tuple_element<I, typename std::remove_reference<Container>::type>
{};
} // namespace std

View file

@ -13,7 +13,7 @@ namespace sprout {
// tuple_size
//
template<typename T1, typename T2>
class tuple_size<sscrisk::cel::pair<T1, T2> >
struct tuple_size<sscrisk::cel::pair<T1, T2> >
: public std::integral_constant<std::size_t, 2>
{};
@ -22,20 +22,20 @@ namespace sprout {
//
namespace detail {
template<std::size_t I, typename T>
class tuple_element_impl;
struct tuple_element_impl;
template<typename T1, typename T2>
class tuple_element_impl<0, sscrisk::cel::pair<T1, T2> > {
struct tuple_element_impl<0, sscrisk::cel::pair<T1, T2> > {
public:
typedef T1 type;
};
template<typename T1, typename T2>
class tuple_element_impl<1, sscrisk::cel::pair<T1, T2> > {
struct tuple_element_impl<1, sscrisk::cel::pair<T1, T2> > {
public:
typedef T2 type;
};
} // namespace detail
template<std::size_t I, typename T1, typename T2>
class tuple_element<I, sscrisk::cel::pair<T1, T2> >
struct tuple_element<I, sscrisk::cel::pair<T1, T2> >
: public sprout::tuples::detail::tuple_element_impl<I, sscrisk::cel::pair<T1, T2> >
{};

View file

@ -416,14 +416,14 @@ namespace sprout {
namespace detail {
template<std::size_t I, typename T>
class tuple_element_impl;
struct tuple_element_impl;
template<typename Head, typename... Tail>
class tuple_element_impl<0, sprout::tuples::tuple<Head, Tail...> > {
struct tuple_element_impl<0, sprout::tuples::tuple<Head, Tail...> > {
public:
typedef Head type;
};
template<std::size_t I, typename Head, typename... Tail>
class tuple_element_impl<I, sprout::tuples::tuple<Head, Tail...> >
struct tuple_element_impl<I, sprout::tuples::tuple<Head, Tail...> >
: public sprout::tuples::detail::tuple_element_impl<I - 1, sprout::tuples::tuple<Tail...> >
{};
} // namespace detail
@ -442,7 +442,7 @@ namespace std {
// tuple_size
//
template<typename... Types>
class tuple_size<sprout::tuples::tuple<Types...> >
struct tuple_size<sprout::tuples::tuple<Types...> >
: public std::integral_constant<std::size_t, sizeof...(Types)>
{};
@ -450,7 +450,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename... Types>
class tuple_element<I, sprout::tuples::tuple<Types...> >
struct tuple_element<I, sprout::tuples::tuple<Types...> >
: public sprout::tuples::detail::tuple_element_impl<I, sprout::tuples::tuple<Types...> >
{};
} // namespace std
@ -461,19 +461,19 @@ namespace sprout {
// tuple_size
//
template<typename T>
class tuple_size
struct tuple_size
: public std::tuple_size<T>
{};
template<typename T>
class tuple_size<T const>
struct tuple_size<T const>
: public sprout::tuples::tuple_size<T>
{};
template<typename T>
class tuple_size<T volatile>
struct tuple_size<T volatile>
: public sprout::tuples::tuple_size<T>
{};
template<typename T>
class tuple_size<T const volatile>
struct tuple_size<T const volatile>
: public sprout::tuples::tuple_size<T>
{};
@ -481,19 +481,19 @@ namespace sprout {
// tuple_element
//
template<std::size_t I, typename T>
class tuple_element
struct tuple_element
: public std::tuple_element<I, T>
{};
template<std::size_t I, typename T>
class tuple_element<I, T const>
struct tuple_element<I, T const>
: public sprout::tuples::tuple_element<I, T>
{};
template<std::size_t I, typename T>
class tuple_element<I, T volatile>
struct tuple_element<I, T volatile>
: public sprout::tuples::tuple_element<I, T>
{};
template<std::size_t I, typename T>
class tuple_element<I, T const volatile>
struct tuple_element<I, T const volatile>
: public sprout::tuples::tuple_element<I, T>
{};

View file

@ -35,14 +35,14 @@ namespace sprout {
// tuple_size
//
template<int... Values>
class tuple_size<boost::mpl::string<Values...> >
struct tuple_size<boost::mpl::string<Values...> >
: public boost::mpl::size<boost::mpl::string<Values...> >
{};
//
// tuple_element
//
template<std::size_t I, int... Values>
class tuple_element<I, boost::mpl::string<Values...> >
struct tuple_element<I, boost::mpl::string<Values...> >
: public boost::mpl::at_c<boost::mpl::string<Values...>, I>
{};

View file

@ -29,14 +29,14 @@ namespace sprout {
// tuple_size
//
template<typename... Types>
class tuple_size<boost::mpl::vector<Types...> >
struct tuple_size<boost::mpl::vector<Types...> >
: public boost::mpl::size<boost::mpl::vector<Types...> >
{};
//
// tuple_element
//
template<std::size_t I, typename... Types>
class tuple_element<I, boost::mpl::vector<Types...> >
struct tuple_element<I, boost::mpl::vector<Types...> >
: public boost::mpl::at_c<boost::mpl::vector<Types...>, I>
{};
} // namespace types

View file

@ -29,14 +29,14 @@ namespace sprout {
// tuple_size
//
template<typename T, T... Values>
class tuple_size<boost::mpl::vector_c<T, Values...> >
struct tuple_size<boost::mpl::vector_c<T, Values...> >
: public boost::mpl::size<boost::mpl::vector_c<T, Values...> >
{};
//
// tuple_element
//
template<std::size_t I, typename T, T... Values>
class tuple_element<I, boost::mpl::vector_c<T, Values...> >
struct tuple_element<I, boost::mpl::vector_c<T, Values...> >
: public boost::mpl::at_c<boost::mpl::vector_c<T, Values...>, I>
{};
} // namespace types

View file

@ -28,7 +28,7 @@ namespace std {
// tuple_size
//
template<typename T, T... Values>
class tuple_size<sprout::types::integral_array<T, Values...> >
struct tuple_size<sprout::types::integral_array<T, Values...> >
: public std::tuple_size<sprout::types::type_tuple<std::integral_constant<T, Values>...> >
{};
@ -36,7 +36,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename T, T... Values>
class tuple_element<I, sprout::types::integral_array<T, Values...> >
struct tuple_element<I, sprout::types::integral_array<T, Values...> >
: public std::tuple_element<I, sprout::types::type_tuple<std::integral_constant<T, Values>...> >
{};
} // namespace std

View file

@ -24,7 +24,7 @@ namespace std {
// tuple_size
//
template<typename T, T... Values>
class tuple_size<sprout::types::basic_string<T, Values...> >
struct tuple_size<sprout::types::basic_string<T, Values...> >
: public std::tuple_size<sprout::types::integral_array<T, Values...> >
{};
@ -32,7 +32,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename T, T... Values>
class tuple_element<I, sprout::types::basic_string<T, Values...> >
struct tuple_element<I, sprout::types::basic_string<T, Values...> >
: public std::tuple_element<I, sprout::types::integral_array<T, Values...> >
{};
} // namespace std

View file

@ -26,14 +26,14 @@ namespace sprout {
// tuple_size
//
template<typename T, typename Enable = void>
class tuple_size
struct tuple_size
: public std::tuple_size<T>
{};
//
// tuple_element
//
template<std::size_t I, typename T, typename Enable = void>
class tuple_element
struct tuple_element
: public std::tuple_element<I, T>
{};
} // namespace types

View file

@ -23,14 +23,14 @@ namespace sprout {
namespace detail {
template<std::size_t I, typename T>
class tuple_element_impl;
struct tuple_element_impl;
template<typename Head, typename... Tail>
class tuple_element_impl<0, sprout::types::type_tuple<Head, Tail...> > {
struct tuple_element_impl<0, sprout::types::type_tuple<Head, Tail...> > {
public:
typedef Head type;
};
template<std::size_t I, typename Head, typename... Tail>
class tuple_element_impl<I, sprout::types::type_tuple<Head, Tail...> >
struct tuple_element_impl<I, sprout::types::type_tuple<Head, Tail...> >
: public sprout::types::detail::tuple_element_impl<I - 1, sprout::types::type_tuple<Tail...> >
{};
} // namespace detail
@ -44,7 +44,7 @@ namespace std {
// tuple_size
//
template<typename... Types>
class tuple_size<sprout::types::type_tuple<Types...> >
struct tuple_size<sprout::types::type_tuple<Types...> >
: public std::integral_constant<std::size_t, sizeof...(Types)>
{};
@ -52,7 +52,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename... Types>
class tuple_element<I, sprout::types::type_tuple<Types...> >
struct tuple_element<I, sprout::types::type_tuple<Types...> >
: public sprout::types::detail::tuple_element_impl<I, sprout::types::type_tuple<Types...> >
{};
} // namespace std

View file

@ -169,14 +169,14 @@ namespace sprout {
namespace tuples {
namespace detail {
template<std::size_t I, typename T>
class tuple_element_impl;
struct tuple_element_impl;
template<typename T1, typename T2>
class tuple_element_impl<0, sprout::pair<T1, T2> > {
struct tuple_element_impl<0, sprout::pair<T1, T2> > {
public:
typedef T1 type;
};
template<typename T1, typename T2>
class tuple_element_impl<1, sprout::pair<T1, T2> > {
struct tuple_element_impl<1, sprout::pair<T1, T2> > {
public:
typedef T2 type;
};
@ -189,7 +189,7 @@ namespace std {
// tuple_size
//
template<typename T1, typename T2>
class tuple_size<sprout::pair<T1, T2> >
struct tuple_size<sprout::pair<T1, T2> >
: public std::integral_constant<std::size_t, 2>
{};
@ -197,7 +197,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename T1, typename T2>
class tuple_element<I, sprout::pair<T1, T2> >
struct tuple_element<I, sprout::pair<T1, T2> >
: public sprout::tuples::detail::tuple_element_impl<I, sprout::pair<T1, T2> >
{};
} // namespace std

View file

@ -264,7 +264,7 @@ namespace std {
// tuple_size
//
template<>
class tuple_size<sprout::uuids::uuid> {
struct tuple_size<sprout::uuids::uuid> {
public:
typedef std::integral_constant<std::size_t, 16> type;
SPROUT_STATIC_CONSTEXPR std::size_t value = type::value;
@ -274,7 +274,7 @@ namespace std {
// tuple_element
//
template<std::size_t I>
class tuple_element<I, sprout::uuids::uuid> {
struct tuple_element<I, sprout::uuids::uuid> {
public:
static_assert(I < 16, "tuple_element<>: index out of range");
typedef sprout::uuids::uuid::value_type type;

View file

@ -266,7 +266,7 @@ namespace std {
// tuple_size
//
template<typename... Types>
class tuple_size<sprout::variant<Types...> >
struct tuple_size<sprout::variant<Types...> >
: public std::tuple_size<typename sprout::variant<Types...>::tuple_type>
{};
@ -274,7 +274,7 @@ namespace std {
// tuple_element
//
template<std::size_t I, typename... Types>
class tuple_element<I, sprout::variant<Types...> >
struct tuple_element<I, sprout::variant<Types...> >
: public std::tuple_element<I, typename sprout::variant<Types...>::tuple_type>
{};
} // namespace std

21
testspr/include_main.hpp Normal file
View file

@ -0,0 +1,21 @@
#ifndef TESTSPR_INCLUDE_MAIN_HPP
#define TESTSPR_INCLUDE_MAIN_HPP
#ifndef TESTSPR_CPP_INCLUDE
#ifndef TESTSPR_TEST_FUNCTION
# error undefined TESTSPR_TEST_FUNCTION
#endif
#include <iostream>
#include <sprout/preprocessor/stringize.hpp>
int main() {
std::cout << "testspr exec: " << SPROUT_PP_STRINGIZE(TESTSPR_TEST_FUNCTION) << std::endl;
TESTSPR_TEST_FUNCTION();
std::cout << "testspr succeeded." << std::endl;
}
#endif
#endif // #ifndef TESTSPR_INCLUDE_MAIN_HPP

View file

@ -1,8 +1,32 @@
#ifndef TESTSPR_SPROUT_CPP
#define TESTSPR_SPROUT_CPP
#include <iostream>
#include <testspr/sprout.hpp>
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_CPP_INCLUDE_DISABLE_TESTSPR_SPROUT_HPP
# define TESTSPR_CPP_INCLUDE
#endif
int main() {
testspr::sprout_test();
std::cout << "testspr succeeded." << std::endl;
}
#include "../libs/array/test/array.cpp"
#include "../libs/string/test/string.cpp"
#include "../libs/algorithm/test/algorithm.cpp"
#include "../libs/random/test/random.cpp"
#ifdef TESTSPR_CPP_INCLUDE_DISABLE_TESTSPR_SPROUT_HPP
# undef TESTSPR_CPP_INCLUDE
#endif
namespace testspr {
static void sprout_test() {
testspr::array_test();
testspr::string_test();
testspr::algorithm_test();
testspr::random_test();
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::sprout_test
# include <testspr/include_main.hpp>
#endif
#endif // #ifndef TESTSPR_SPROUT_CPP

View file

@ -1,18 +0,0 @@
#ifndef TESTSPR_SPROUT_HPP
#define TESTSPR_SPROUT_HPP
#include <testspr/sprout/array.hpp>
#include <testspr/sprout/string.hpp>
#include <testspr/sprout/algorithm.hpp>
#include <testspr/sprout/random.hpp>
namespace testspr {
static void sprout_test() {
testspr::array_test();
testspr::string_test();
testspr::algorithm_test();
testspr::random_test();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_HPP

View file

@ -1,12 +0,0 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_HPP
#define TESTSPR_SPROUT_ALGORITHM_HPP
#include <testspr/sprout/algorithm/modifying.hpp>
namespace testspr {
static void algorithm_test() {
testspr::algorithm_modifying_test();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_HPP

View file

@ -1,106 +0,0 @@
#ifndef TESTSPR_SPROUT_ALGORITHM_MODIFYIING_HPP
#define TESTSPR_SPROUT_ALGORITHM_MODIFYIING_HPP
#include <testspr/sprout/algorithm/copy.hpp>
#include <testspr/sprout/algorithm/copy_n.hpp>
#include <testspr/sprout/algorithm/copy_if.hpp>
#include <testspr/sprout/algorithm/copy_backward.hpp>
#include <testspr/sprout/algorithm/transform.hpp>
#include <testspr/sprout/algorithm/replace.hpp>
#include <testspr/sprout/algorithm/replace_if.hpp>
#include <testspr/sprout/algorithm/replace_copy.hpp>
#include <testspr/sprout/algorithm/replace_copy_if.hpp>
#include <testspr/sprout/algorithm/fill.hpp>
#include <testspr/sprout/algorithm/fill_n.hpp>
#include <testspr/sprout/algorithm/generate.hpp>
#include <testspr/sprout/algorithm/generate_n.hpp>
#include <testspr/sprout/algorithm/remove.hpp>
#include <testspr/sprout/algorithm/remove_if.hpp>
#include <testspr/sprout/algorithm/remove_copy.hpp>
#include <testspr/sprout/algorithm/remove_copy_if.hpp>
#include <testspr/sprout/algorithm/unique.hpp>
#include <testspr/sprout/algorithm/unique_copy.hpp>
#include <testspr/sprout/algorithm/reverse.hpp>
#include <testspr/sprout/algorithm/reverse_copy.hpp>
#include <testspr/sprout/algorithm/rotate.hpp>
#include <testspr/sprout/algorithm/rotate_copy.hpp>
#include <testspr/sprout/algorithm/shuffle.hpp>
#include <testspr/sprout/algorithm/shuffle_result.hpp>
#include <testspr/sprout/algorithm/partition.hpp>
#include <testspr/sprout/algorithm/partition_copy.hpp>
#include <testspr/sprout/algorithm/stable_partition.hpp>
#include <testspr/sprout/algorithm/stable_partition_copy.hpp>
#include <testspr/sprout/algorithm/sort.hpp>
#include <testspr/sprout/algorithm/stable_sort.hpp>
#include <testspr/sprout/algorithm/partial_sort.hpp>
#include <testspr/sprout/algorithm/nth_element.hpp>
#include <testspr/sprout/algorithm/merge.hpp>
#include <testspr/sprout/algorithm/inplace_merge.hpp>
#include <testspr/sprout/algorithm/set_union.hpp>
#include <testspr/sprout/algorithm/set_intersection.hpp>
#include <testspr/sprout/algorithm/set_difference.hpp>
#include <testspr/sprout/algorithm/set_symmetric_difference.hpp>
#include <testspr/sprout/algorithm/push_heap.hpp>
#include <testspr/sprout/algorithm/pop_heap.hpp>
#include <testspr/sprout/algorithm/make_heap.hpp>
#include <testspr/sprout/algorithm/make_partial_heap.hpp>
#include <testspr/sprout/algorithm/sort_heap.hpp>
#include <testspr/sprout/algorithm/swap_element.hpp>
#include <testspr/sprout/algorithm/swap_element_copy.hpp>
#include <testspr/sprout/algorithm/bogo_sort.hpp>
#include <testspr/sprout/algorithm/bogo_sort_result.hpp>
namespace testspr {
static void algorithm_modifying_test() {
testspr::algorithm_copy_test();
testspr::algorithm_copy_n_test();
testspr::algorithm_copy_if_test();
testspr::algorithm_copy_backward_test();
testspr::algorithm_transform_test();
testspr::algorithm_replace_test();
testspr::algorithm_replace_if_test();
testspr::algorithm_replace_copy_test();
testspr::algorithm_replace_copy_if_test();
testspr::algorithm_fill_test();
testspr::algorithm_fill_n_test();
testspr::algorithm_generate_test();
testspr::algorithm_generate_n_test();
testspr::algorithm_remove_test();
testspr::algorithm_remove_if_test();
testspr::algorithm_remove_copy_test();
testspr::algorithm_remove_copy_if_test();
testspr::algorithm_unique_test();
testspr::algorithm_unique_copy_test();
testspr::algorithm_reverse_test();
testspr::algorithm_reverse_copy_test();
testspr::algorithm_rotate_test();
testspr::algorithm_rotate_copy_test();
testspr::algorithm_shuffle_test();
testspr::algorithm_shuffle_result_test();
testspr::algorithm_partition_test();
testspr::algorithm_partition_copy_test();
testspr::algorithm_stable_partition_test();
testspr::algorithm_stable_partition_copy_test();
testspr::algorithm_sort_test();
testspr::algorithm_stable_sort_test();
testspr::algorithm_partial_sort_test();
testspr::algorithm_nth_element_test();
testspr::algorithm_merge_test();
testspr::algorithm_inplace_merge_test();
testspr::algorithm_set_union_test();
testspr::algorithm_set_intersection_test();
testspr::algorithm_set_difference_test();
testspr::algorithm_set_symmetric_difference_test();
testspr::algorithm_push_heap_test();
testspr::algorithm_pop_heap_test();
testspr::algorithm_make_heap_test();
testspr::algorithm_make_partial_heap_test();
testspr::algorithm_sort_heap_test();
testspr::algorithm_swap_element_test();
testspr::algorithm_swap_element_copy_test();
testspr::algorithm_bogo_sort_test();
testspr::algorithm_bogo_sort_result_test();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_ALGORITHM_MODIFYIING_HPP

View file

@ -1,41 +0,0 @@
#ifndef TESTSPR_SPROUT_RANDOM_HPP
#define TESTSPR_SPROUT_RANDOM_HPP
#include <testspr/sprout/random/linear_congruential.hpp>
#include <testspr/sprout/random/additive_combine.hpp>
#include <testspr/sprout/random/shuffle_order.hpp>
#include <testspr/sprout/random/inversive_congruential.hpp>
#include <testspr/sprout/random/taus88.hpp>
//#include <testspr/sprout/random/mersenne_twister.hpp>
#include <testspr/sprout/random/uniform_smallint.hpp>
#include <testspr/sprout/random/uniform_int_distribution.hpp>
#include <testspr/sprout/random/uniform_01.hpp>
#include <testspr/sprout/random/uniform_real_distribution.hpp>
#include <testspr/sprout/random/bernoulli_distribution.hpp>
#include <testspr/sprout/random/binomial_distribution.hpp>
#include <testspr/sprout/random/geometric_distribution.hpp>
#include <testspr/sprout/random/normal_distribution.hpp>
#include <testspr/tools.hpp>
namespace testspr {
void random_test() {
using namespace sprout;
testspr::random_linear_congruential_test();
testspr::random_additive_combine_test();
testspr::random_shuffle_order_test();
testspr::random_inversive_congruential_test();
testspr::random_taus88_test();
//testspr::random_mersenne_twister_test();
testspr::random_uniform_smallint_test();
testspr::random_uniform_int_distribution_test();
testspr::random_uniform_01_test();
testspr::random_uniform_real_distribution_test();
testspr::random_bernoulli_distribution_test();
testspr::random_binomial_distribution_test();
testspr::random_geometric_distribution_test();
testspr::random_normal_distribution_test();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_HPP

View file

@ -1,16 +0,0 @@
#ifndef TESTSPR_SPROUT_RANDOM_ADDITIVE_COMBINE_HPP
#define TESTSPR_SPROUT_RANDOM_ADDITIVE_COMBINE_HPP
#include <sprout/random/additive_combine.hpp>
#include <testspr/sprout/random/engine_generic.hpp>
#include <testspr/tools.hpp>
namespace testspr {
void random_additive_combine_test() {
using namespace sprout;
testspr::random_engine_test_generic<sprout::random::ecuyer1988>();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_ADDITIVE_COMBINE_HPP

View file

@ -1,16 +0,0 @@
#ifndef TESTSPR_SPROUT_RANDOM_BERNOULLI_DISTRIBUTION_HPP
#define TESTSPR_SPROUT_RANDOM_BERNOULLI_DISTRIBUTION_HPP
#include <sprout/random/bernoulli_distribution.hpp>
#include <testspr/sprout/random/distribution_generic.hpp>
#include <testspr/tools.hpp>
namespace testspr {
void random_bernoulli_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::bernoulli_distribution<> >();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_BERNOULLI_DISTRIBUTION_HPP

View file

@ -1,16 +0,0 @@
#ifndef TESTSPR_SPROUT_RANDOM_BINOMIAL_DISTRIBUTION_HPP
#define TESTSPR_SPROUT_RANDOM_BINOMIAL_DISTRIBUTION_HPP
#include <sprout/random/binomial_distribution.hpp>
#include <testspr/sprout/random/distribution_generic.hpp>
#include <testspr/tools.hpp>
namespace testspr {
void random_binomial_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::binomial_distribution<> >();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_BINOMIAL_DISTRIBUTION_HPP

View file

@ -1,16 +0,0 @@
#ifndef TESTSPR_SPROUT_RANDOM_GEOMETRIC_DISTRIBUTION_HPP
#define TESTSPR_SPROUT_RANDOM_GEOMETRIC_DISTRIBUTION_HPP
#include <sprout/random/geometric_distribution.hpp>
#include <testspr/sprout/random/distribution_generic.hpp>
#include <testspr/tools.hpp>
namespace testspr {
void random_geometric_distribution_test() {
using namespace sprout;
testspr::random_distribution_test_generic<sprout::random::geometric_distribution<> >();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_GEOMETRIC_DISTRIBUTION_HPP

View file

@ -1,16 +0,0 @@
#ifndef TESTSPR_SPROUT_RANDOM_INVERSIVE_CONGRUENTIAL_HPP
#define TESTSPR_SPROUT_RANDOM_INVERSIVE_CONGRUENTIAL_HPP
#include <sprout/random/linear_congruential.hpp>
#include <testspr/sprout/random/engine_generic.hpp>
#include <testspr/tools.hpp>
namespace testspr {
void random_inversive_congruential_test() {
using namespace sprout;
testspr::random_engine_test_generic<sprout::random::hellekalek1995>();
}
} // namespace testspr
#endif // #ifndef TESTSPR_SPROUT_RANDOM_INVERSIVE_CONGRUENTIAL_HPP

Some files were not shown because too many files have changed in this diff Show more