-
Notifications
You must be signed in to change notification settings - Fork 550
Expand file tree
/
Copy patharray_death_tests.cpp
More file actions
63 lines (46 loc) · 1.23 KB
/
array_death_tests.cpp
File metadata and controls
63 lines (46 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*******************************************************
* Copyright (c) 2021, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <arrayfire.h>
#include <gtest/gtest.h>
#include <cstdlib>
using af::array;
using af::constant;
using af::dim4;
using af::end;
using af::fft;
using af::info;
using af::randu;
using af::scan;
using af::seq;
using af::setDevice;
using af::sin;
using af::sort;
template<typename T>
class ArrayDeathTest : public ::testing::Test {};
void deathTest() {
info();
setDevice(0);
array A = randu(5, 3, f32);
array B = sin(A) + 1.5;
B(seq(0, 2), 1) = B(seq(0, 2), 1) * -1;
array C = fft(B);
array c = C.row(end);
dim4 dims(16, 4, 1, 1);
array r = constant(2, dims);
array S = scan(r, 0, AF_BINARY_MUL);
float d[] = {1, 2, 3, 4, 5, 6};
array D(2, 3, d, afHost);
D.col(0) = D.col(end);
array vals, inds;
sort(vals, inds, A);
_exit(0);
}
TEST(ArrayDeathTest, ProxyMoveAssignmentOperator) {
EXPECT_EXIT(deathTest(), ::testing::ExitedWithCode(0), "");
}