Skip to content

Commit e73a25f

Browse files
sdk: move ABI into details (#548)
Reduce the likelihood of extension authors accidentally taking a dependency on the ABI.
1 parent 50ce726 commit e73a25f

3 files changed

Lines changed: 209 additions & 177 deletions

File tree

unittest/gunit/villagesql/type_builder-t.cc

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,56 +82,51 @@ static constexpr const char kParamsName[] = "TESTPARAMS";
8282
namespace trait_tests {
8383

8484
// Non-parameterized: all four operations should yield void.
85-
static_assert(std::is_void_v<vsql::func_builder::TypeOpParamsType<
85+
static_assert(std::is_void_v<vsql::func_builder::detail::TypeOpParamsType<
8686
vsql::func_builder::TypeEncodeFunc>::type>);
87-
static_assert(std::is_void_v<vsql::func_builder::TypeOpParamsType<
87+
static_assert(std::is_void_v<vsql::func_builder::detail::TypeOpParamsType<
8888
vsql::func_builder::TypeDecodeFunc>::type>);
89-
static_assert(std::is_void_v<vsql::func_builder::TypeOpParamsType<
89+
static_assert(std::is_void_v<vsql::func_builder::detail::TypeOpParamsType<
9090
vsql::func_builder::TypeCompareFunc>::type>);
91-
static_assert(std::is_void_v<vsql::func_builder::TypeOpParamsType<
91+
static_assert(std::is_void_v<vsql::func_builder::detail::TypeOpParamsType<
9292
vsql::func_builder::TypeHashFunc>::type>);
9393

9494
// Parameterized: all four operations should yield the params type.
9595
static_assert(
9696
std::is_same_v<
97-
vsql::func_builder::TypeOpParamsType<
97+
vsql::func_builder::detail::TypeOpParamsType<
9898
vsql::func_builder::TypeEncodeWithParamsFunc<TestParams>>::type,
9999
TestParams>);
100100
static_assert(
101101
std::is_same_v<
102-
vsql::func_builder::TypeOpParamsType<
102+
vsql::func_builder::detail::TypeOpParamsType<
103103
vsql::func_builder::TypeDecodeWithParamsFunc<TestParams>>::type,
104104
TestParams>);
105105
static_assert(
106106
std::is_same_v<
107-
vsql::func_builder::TypeOpParamsType<
107+
vsql::func_builder::detail::TypeOpParamsType<
108108
vsql::func_builder::TypeCompareWithParamsFunc<TestParams>>::type,
109109
TestParams>);
110110
static_assert(std::is_same_v<
111-
vsql::func_builder::TypeOpParamsType<
111+
vsql::func_builder::detail::TypeOpParamsType<
112112
vsql::func_builder::TypeHashWithParamsFunc<TestParams>>::type,
113113
TestParams>);
114114

115115
// Concrete function pointers: verify trait works on actual function addresses.
116-
static_assert(
117-
std::is_void_v<
118-
vsql::func_builder::TypeOpParamsType<decltype(&plain_encode)>::type>);
119-
static_assert(
120-
std::is_same_v<
121-
vsql::func_builder::TypeOpParamsType<decltype(&params_encode)>::type,
122-
TestParams>);
123-
static_assert(
124-
std::is_same_v<
125-
vsql::func_builder::TypeOpParamsType<decltype(&params_decode)>::type,
126-
TestParams>);
127-
static_assert(
128-
std::is_same_v<
129-
vsql::func_builder::TypeOpParamsType<decltype(&params_compare)>::type,
130-
TestParams>);
131-
static_assert(
132-
std::is_same_v<
133-
vsql::func_builder::TypeOpParamsType<decltype(&params_hash)>::type,
134-
TestParams>);
116+
static_assert(std::is_void_v<vsql::func_builder::detail::TypeOpParamsType<
117+
decltype(&plain_encode)>::type>);
118+
static_assert(std::is_same_v<vsql::func_builder::detail::TypeOpParamsType<
119+
decltype(&params_encode)>::type,
120+
TestParams>);
121+
static_assert(std::is_same_v<vsql::func_builder::detail::TypeOpParamsType<
122+
decltype(&params_decode)>::type,
123+
TestParams>);
124+
static_assert(std::is_same_v<vsql::func_builder::detail::TypeOpParamsType<
125+
decltype(&params_compare)>::type,
126+
TestParams>);
127+
static_assert(std::is_same_v<vsql::func_builder::detail::TypeOpParamsType<
128+
decltype(&params_hash)>::type,
129+
TestParams>);
135130

136131
} // namespace trait_tests
137132

0 commit comments

Comments
 (0)