mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:26:17 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
52
sdk/lib/3rdparty/stlport/test/unit/plusminus_test.cpp
vendored
Normal file
52
sdk/lib/3rdparty/stlport/test/unit/plusminus_test.cpp
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
#include <numeric>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
#include "cppunit/cppunit_proxy.h"
|
||||
|
||||
#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
//
|
||||
// TestCase class
|
||||
//
|
||||
class PlusMinusTest : public CPPUNIT_NS::TestCase
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(PlusMinusTest);
|
||||
CPPUNIT_TEST(plus0);
|
||||
CPPUNIT_TEST(minus0);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
protected:
|
||||
void plus0();
|
||||
void minus0();
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(PlusMinusTest);
|
||||
|
||||
//
|
||||
// tests implementation
|
||||
//
|
||||
void PlusMinusTest::plus0()
|
||||
{
|
||||
int input1 [4] = { 1, 6, 11, 8 };
|
||||
int input2 [4] = { 1, 5, 2, 3 };
|
||||
|
||||
int total = inner_product(input1, input1 + 4, input2, 0, plus<int>(), multiplies <int>());
|
||||
|
||||
CPPUNIT_ASSERT(total==77);
|
||||
}
|
||||
void PlusMinusTest::minus0()
|
||||
{
|
||||
int input1 [4] = { 1, 5, 7, 8 };
|
||||
int input2 [4] = { 1, 4, 8, 3 };
|
||||
|
||||
int output [4];
|
||||
|
||||
transform((int*)input1, (int*)input1 + 4, (int*)input2, (int*)output, minus<int>());
|
||||
CPPUNIT_ASSERT(output[0]==0);
|
||||
CPPUNIT_ASSERT(output[1]==1);
|
||||
CPPUNIT_ASSERT(output[2]==-1);
|
||||
CPPUNIT_ASSERT(output[3]==5);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue