Skip to content

Commit

Permalink
renamed stlalgotest and removed unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoessbauer committed Jul 31, 2017
1 parent 9800e63 commit 4919876
Showing 3 changed files with 31 additions and 31 deletions.
20 changes: 10 additions & 10 deletions dash/test/iterator/GlobIterTest.cc → dash/test/StlAlgoTest.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

#include "GlobIterTest.h"
#include "StlAlgoTest.h"

#include <dash/Array.h>
#include <algorithm>

TEST_F(GlobIterTest, CompilerADLTest){
TEST_F(StlAlgoTest, CompilerADLTest){
dash::Array<int> arr(dash::size());
arr.local[0] = static_cast<int>(dash::myid());
arr.local[0] = dash::myid();
arr.barrier();

if(dash::myid() == 0){
@@ -39,10 +39,10 @@ TEST_F(GlobIterTest, CompilerADLTest){
}
}

TEST_F(GlobIterTest, Swap) {
TEST_F(StlAlgoTest, Swap) {
using std::swap;
dash::Array<int> arr(dash::size());
arr.local[0] = static_cast<int>(dash::myid());
arr.local[0] = dash::myid();
arr.barrier();

if(dash::myid() == 0){
@@ -53,27 +53,27 @@ TEST_F(GlobIterTest, Swap) {
}
arr.barrier();
int newbegval = arr[0];
int newendval = arr[static_cast<int>(dash::size()-1)];
int newendval = arr[dash::size()-1];
ASSERT_EQ_U(newbegval, dash::size()-1);
ASSERT_EQ_U(newendval, 0);
}

TEST_F(GlobIterTest, IterSwap) {
TEST_F(StlAlgoTest, IterSwap) {
dash::Array<int> arr(dash::size());
arr.local[0] = static_cast<int>(dash::myid());
arr.local[0] = dash::myid();
arr.barrier();

if(dash::myid() == 0){
std::iter_swap(arr.begin(), arr.end()-1);
}
arr.barrier();
int newbegval = arr[0];
int newendval = arr[static_cast<int>(dash::size()-1)];
int newendval = arr[dash::size()-1];
ASSERT_EQ_U(newbegval, dash::size()-1);
ASSERT_EQ_U(newendval, 0);
}

TEST_F(GlobIterTest, Sort) {
TEST_F(StlAlgoTest, Sort) {
// do not use that in production as this is inefficient as hell!
dash::Array<int> arr(dash::size());
// init array in reverse order [n-1,n-2,...,0]
21 changes: 21 additions & 0 deletions dash/test/StlAlgoTest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef DASH__TEST__STL_ALGO_TEST_H_
#define DASH__TEST__STL_ALGO_TEST_H_

#include "TestBase.h"

/**
* Tests compability of dash iterators and STL algorithms
*/
class StlAlgoTest : public dash::test::TestBase {
protected:

StlAlgoTest() {
LOG_MESSAGE(">>> Test suite: StlAlgoTest");
}

virtual ~StlAlgoTest() {
LOG_MESSAGE("<<< Closing test suite: StlAlgoTest");
}
};

#endif // DASH__TEST__STL_ALGO_TEST_H_
21 changes: 0 additions & 21 deletions dash/test/iterator/GlobIterTest.h

This file was deleted.

0 comments on commit 4919876

Please sign in to comment.