mirror of
https://github.com/boostorg/algorithm.git
synced 2025-07-30 04:27:16 +02:00
Documentation updates and new Doxyfile; new unit test and minor fix;
moved minmax_macro; new example. [SVN r52655]
This commit is contained in:
18
all/test/Jamfile.v2
Normal file
18
all/test/Jamfile.v2
Normal file
@ -0,0 +1,18 @@
|
||||
# Boost.All Library test Jamfile
|
||||
#
|
||||
# Copyright (C) 2009 Jesse Williamson
|
||||
#
|
||||
# Use, modification, and distribution is subject to the Boost Software
|
||||
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
|
||||
import testing ;
|
||||
|
||||
{
|
||||
test-suite algorithm/all:
|
||||
: [ run all_test.cpp
|
||||
: : : : all ]
|
||||
;
|
||||
}
|
||||
|
46
all/test/all_test.cpp
Normal file
46
all/test/all_test.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
// (C) Copyright Jesse Williamson 2009
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/all.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#include <utility>
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
|
||||
// This prettyprinter is useful when debugging:
|
||||
template <class T>
|
||||
void show(std::vector<T>& v)
|
||||
{
|
||||
for(typename std::vector<T>::const_iterator i = v.begin(); i != v.end(); ++i)
|
||||
std::cout << *i << '\n';
|
||||
|
||||
std::cout << "----------" << std::endl;
|
||||
}
|
||||
|
||||
namespace ba = boost::algorithm;
|
||||
|
||||
void test_none()
|
||||
{
|
||||
// Note: The literal values here are tested against directly, careful if you change them:
|
||||
int some_numbers[] = { 1, 5, 0, 18, 1 };
|
||||
std::vector<int> vi(some_numbers, some_numbers + 5);
|
||||
|
||||
int some_letters[] = { 'a', 'q', 'n', 'y', 'n' };
|
||||
std::vector<char> vc(some_letters, some_letters + 5);
|
||||
|
||||
BOOST_CHECK_EQUAL(true, ba::none(vi, 100));
|
||||
BOOST_CHECK_EQUAL(false, ba::none(vi, 1));
|
||||
|
||||
BOOST_CHECK_EQUAL(true, ba::none(vc, 'z'));
|
||||
BOOST_CHECK_EQUAL(false, ba::none(vc, 'a'));
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
{
|
||||
test_none();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user