File: test_fftw_prop_hash.cpp

package info (click to toggle)
spfft 1.1.1-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,688 kB
  • sloc: cpp: 11,562; f90: 665; ansic: 437; python: 41; makefile: 24
file content (21 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <unordered_set>
#include "gtest/gtest.h"
#include "fft/fftw_plan_1d.hpp"


TEST(FFTWPropHashTest, Unique) {
  std::unordered_set<std::tuple<bool, int, int>,  spfft::FFTWPropHash> set;

  int maxAlignment = 1024;

  for (int inPlace = 0; inPlace < 2; ++inPlace) {
    for (int i = 0 ;i < maxAlignment; ++i) {
      for (int j = 0; j < maxAlignment; ++j) {
        set.emplace(inPlace, i, j);
      }
    }
  }

  EXPECT_EQ(static_cast<std::size_t>(maxAlignment) * static_cast<std::size_t>(maxAlignment) * 2,
            set.size());
}