-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
3,038 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#ifndef NMTOOLS_TESTING_DATA_ARRAY_HSTACK_HPP | ||
#define NMTOOLS_TESTING_DATA_ARRAY_HSTACK_HPP | ||
|
||
#include "nmtools/testing/testing.hpp" | ||
|
||
NMTOOLS_TESTING_DECLARE_CASE(hstack) | ||
{ | ||
NMTOOLS_TESTING_DECLARE_ARGS(case1) | ||
{ | ||
inline int a[3] = {1,2,3}; | ||
inline int b[3] = {4,5,6}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case1) | ||
{ | ||
inline int result[6] = {1,2,3,4,5,6}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case2) | ||
{ | ||
inline int a[2][3] = { | ||
{1,2,3}, | ||
{4,5,6}, | ||
}; | ||
inline int b[2][3] = { | ||
{ 7, 8, 9}, | ||
{10,11,12}, | ||
}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case2) | ||
{ | ||
inline int result[2][6] = { | ||
{ 1, 2, 3, 7, 8, 9}, | ||
{ 4, 5, 6,10,11,12}, | ||
}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case3) | ||
{ | ||
inline int a[2][3][2] = { | ||
{ | ||
{1,2}, | ||
{3,4}, | ||
{5,6}, | ||
}, | ||
{ | ||
{ 7, 8}, | ||
{ 9,10}, | ||
{11,12}, | ||
} | ||
}; | ||
inline int b[2][3][2] = { | ||
{ | ||
{13,14}, | ||
{15,16}, | ||
{17,18}, | ||
}, | ||
{ | ||
{19,20}, | ||
{21,22}, | ||
{23,24}, | ||
} | ||
}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case3) | ||
{ | ||
inline int result[2][6][2] = { | ||
{ | ||
{ 1, 2}, | ||
{ 3, 4}, | ||
{ 5, 6}, | ||
{13,14}, | ||
{15,16}, | ||
{17,18}, | ||
}, | ||
{ | ||
{ 7, 8}, | ||
{ 9,10}, | ||
{11,12}, | ||
{19,20}, | ||
{21,22}, | ||
{23,24}, | ||
} | ||
}; | ||
} | ||
} | ||
|
||
#endif // NMTOOLS_TESTING_DATA_ARRAY_HSTACK_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
#ifndef NMTOOLS_TESTING_DATA_ARRAY_STACK_HPP | ||
#define NMTOOLS_TESTING_DATA_ARRAY_STACK_HPP | ||
|
||
#include "nmtools/testing/testing.hpp" | ||
|
||
NMTOOLS_TESTING_DECLARE_CASE(stack) | ||
{ | ||
NMTOOLS_TESTING_DECLARE_ARGS(case1) | ||
{ | ||
inline int a[3] = {1,2,3}; | ||
inline int b[3] = {4,5,6}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case1) | ||
{ | ||
inline int result[2][3] = { | ||
{1,2,3}, | ||
{4,5,6}, | ||
}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case2) | ||
{ | ||
inline int a[3] = {1,2,3}; | ||
inline int b[3] = {4,5,6}; | ||
inline int axis = 1; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case2) | ||
{ | ||
inline int result[3][2] = { | ||
{1,4}, | ||
{2,5}, | ||
{3,6}, | ||
}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case3) | ||
{ | ||
inline int a[2][3] = { | ||
{1,2,3}, | ||
{4,5,6}, | ||
}; | ||
inline int b[2][3] = { | ||
{ 7, 8, 9}, | ||
{10,11,12}, | ||
}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case3) | ||
{ | ||
inline int result[2][2][3] = { | ||
{ | ||
{1,2,3}, | ||
{4,5,6}, | ||
}, | ||
{ | ||
{ 7, 8, 9}, | ||
{10,11,12}, | ||
} | ||
}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case4) | ||
{ | ||
inline int a[2][3] = { | ||
{1,2,3}, | ||
{4,5,6}, | ||
}; | ||
inline int b[2][3] = { | ||
{ 7, 8, 9}, | ||
{10,11,12}, | ||
}; | ||
inline int axis = 1; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case4) | ||
{ | ||
inline int result[2][2][3] = { | ||
{ | ||
{1,2,3}, | ||
{7,8,9}, | ||
}, | ||
{ | ||
{ 4, 5, 6}, | ||
{10,11,12}, | ||
} | ||
}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case5) | ||
{ | ||
inline int a[2][3] = { | ||
{1,2,3}, | ||
{4,5,6}, | ||
}; | ||
inline int b[2][3] = { | ||
{ 7, 8, 9}, | ||
{10,11,12}, | ||
}; | ||
inline int axis = 2; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case5) | ||
{ | ||
inline int result[2][3][2] = { | ||
{ | ||
{1,7}, | ||
{2,8}, | ||
{3,9}, | ||
}, | ||
{ | ||
{4,10}, | ||
{5,11}, | ||
{6,12}, | ||
} | ||
}; | ||
} | ||
} | ||
|
||
#endif // NMTOOLS_TESTING_DATA_ARRAY_STACK_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#ifndef NMTOOLS_TESTING_DATA_ARRAY_VSTACK_HPP | ||
#define NMTOOLS_TESTING_DATA_ARRAY_VSTACK_HPP | ||
|
||
#include "nmtools/testing/testing.hpp" | ||
|
||
NMTOOLS_TESTING_DECLARE_CASE(vstack) | ||
{ | ||
NMTOOLS_TESTING_DECLARE_ARGS(case1) | ||
{ | ||
inline int a[3] = {1,2,3}; | ||
inline int b[3] = {4,5,6}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case1) | ||
{ | ||
inline int result[2][3] = { | ||
{1,2,3}, | ||
{4,5,6} | ||
}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case2) | ||
{ | ||
inline int a[2][3] = { | ||
{1,2,3}, | ||
{4,5,6}, | ||
}; | ||
inline int b[2][3] = { | ||
{ 7, 8, 9}, | ||
{10,11,12}, | ||
}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case2) | ||
{ | ||
inline int result[4][3] = { | ||
{ 1, 2, 3}, | ||
{ 4, 5, 6}, | ||
{ 7, 8, 9}, | ||
{10,11,12}, | ||
}; | ||
} | ||
|
||
NMTOOLS_TESTING_DECLARE_ARGS(case3) | ||
{ | ||
inline int a[2][3][2] = { | ||
{ | ||
{1,2}, | ||
{3,4}, | ||
{5,6}, | ||
}, | ||
{ | ||
{ 7, 8}, | ||
{ 9,10}, | ||
{11,12}, | ||
} | ||
}; | ||
inline int b[2][3][2] = { | ||
{ | ||
{13,14}, | ||
{15,16}, | ||
{17,18}, | ||
}, | ||
{ | ||
{19,20}, | ||
{21,22}, | ||
{23,24}, | ||
} | ||
}; | ||
NMTOOLS_CAST_ARRAYS(a) | ||
NMTOOLS_CAST_ARRAYS(b) | ||
} | ||
NMTOOLS_TESTING_DECLARE_EXPECT(case3) | ||
{ | ||
inline int result[4][3][2] = { | ||
{ | ||
{ 1, 2}, | ||
{ 3, 4}, | ||
{ 5, 6}, | ||
}, | ||
{ | ||
{ 7, 8}, | ||
{ 9,10}, | ||
{11,12}, | ||
}, | ||
{ | ||
{13,14}, | ||
{15,16}, | ||
{17,18}, | ||
}, | ||
{ | ||
{19,20}, | ||
{21,22}, | ||
{23,24}, | ||
} | ||
}; | ||
} | ||
} | ||
|
||
#endif // NMTOOLS_TESTING_DATA_ARRAY_VSTACK_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.