From 51435775b96b32192a2d79cb1d1567c9a542d7a6 Mon Sep 17 00:00:00 2001 From: Nick Sharp Date: Wed, 17 Jul 2019 09:42:17 -0400 Subject: [PATCH] minor --- include/polyscope/standardize_data_array.h | 5 +++-- test/src/array_adaptors_test.cpp | 16 +++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/polyscope/standardize_data_array.h b/include/polyscope/standardize_data_array.h index e7b0d26e..37b97443 100644 --- a/include/polyscope/standardize_data_array.h +++ b/include/polyscope/standardize_data_array.h @@ -802,8 +802,9 @@ std::vector adaptorF_convertArrayOfVectorToStdVector(const T& inputData) { // - any user defined function // std::vector> adaptorF_custom_convertNestedArrayToStdVector(const YOUR_TYPE& inputData); // - dense callable (parenthesis) access (like T(i,j)), on a type that supports .rows() and .cols() -// - double bracket access (like T[i][j]), where the outer and inner array types -// - iterable +// - recursive unpacking with bracket +// - recursive unpacking with parent +// - recursive unpacking with iterable // Note: this dummy function is defined so the non-dependent name adaptorF_custom_convertArrayOfVectorToStdVector will diff --git a/test/src/array_adaptors_test.cpp b/test/src/array_adaptors_test.cpp index becef0dd..32e9ee4b 100644 --- a/test/src/array_adaptors_test.cpp +++ b/test/src/array_adaptors_test.cpp @@ -9,6 +9,9 @@ #include #include +#define POLYSCOPE_NO_STANDARDIZE_FALLTHROUGH + +#include "polyscope/standardize_data_array.h" using std::cout; using std::endl; @@ -35,7 +38,7 @@ struct UserArray { UserArray userArray_sizeFunc{{0.1, 0.2, 0.3, 0.4, 0.5}}; // Size function for custom array -size_t adaptorF_size(const UserArray& c) { return c.bigness(); } +size_t adaptorF_custom_size(const UserArray& c) { return c.bigness(); } // == A type that we access with callable (paren) @@ -58,7 +61,6 @@ UserArrayCallableInt userArray_callableAccessInt{{0.1, 0.2, 0.3, 0.4, 0.5}}; // == A type that requires a custom access function -// (Eigen works this way, but don't want to depend on Eigen) struct UserArrayFuncAccess { std::vector myData; size_t size() const { return myData.size(); } @@ -187,12 +189,6 @@ UserNestedListCustom userArray_nestedListCustom{{{1, 2, 3}, {4, 5, 6, 7}}}; } // namespace -#define POLYSCOPE_NO_STANDARDIZE_FALLTHROUGH - -// This include is intentionally after the definitions above, so it can pick them up -#include "polyscope/standardize_data_array.h" - - // Test that validateSize works when the type has a .size() member TEST(ArrayAdaptorTests, validateSize_MemberMethod) { polyscope::validateSize(arr_vecdouble, 5, "test"); @@ -205,7 +201,9 @@ TEST(ArrayAdaptorTests, validateSize_MemberMethod) { // Test that validateSize works with a custom overload -TEST(ArrayAdaptorTests, validateSize_Custom) { polyscope::validateSize(userArray_sizeFunc, 5, "test"); } +TEST(ArrayAdaptorTests, validateSize_Custom) { + polyscope::validateSize(userArray_sizeFunc, 5, "test"); +} // Test that standardizeArray works with bracket access