summaryrefslogtreecommitdiff
path: root/test/test_common.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-09-23 07:36:16 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-09-23 07:36:16 -0500
commit0b860bb5dd6d2007db605291d239a6a9d41f57d1 (patch)
treefab140e03a3665236503d1405de9d33ba58ccc4a /test/test_common.hpp
parent7da829d48f9059c83ab9cada2c850621e8bbd3f3 (diff)
Installable library.
Diffstat (limited to 'test/test_common.hpp')
-rw-r--r--test/test_common.hpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/test_common.hpp b/test/test_common.hpp
new file mode 100644
index 0000000..fa6cf09
--- /dev/null
+++ b/test/test_common.hpp
@@ -0,0 +1,43 @@
+/*
+ * libfud
+ * Copyright 2024 Dominick Allen
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef EXT_TEST_COMMON_HPP
+#define EXT_TEST_COMMON_HPP
+
+#include <cstddef>
+#include <cstdlib>
+
+namespace ext_lib {
+
+// NOLINTBEGIN(cppcoreguidelines-macro-usage)
+#define MULTI_BYTE_LITERAL "test今日素敵はですねƩ®😀z"
+static_assert(sizeof(MULTI_BYTE_LITERAL) == 38); // NOLINT(readability-magic-numbers)
+#define TWO_BYTE "Ʃ"
+static_assert(sizeof(TWO_BYTE) == 2 + 1);
+#define THREE_BYTE "今"
+static_assert(sizeof(THREE_BYTE) == 3 + 1);
+#define FOUR_BYTE "😀"
+static_assert(sizeof(FOUR_BYTE) == 4 + 1);
+
+#define CHQUOTE "why waste time learning, when ignorance is instantaneous?"
+#define CHARACTER_SET "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+// NOLINTEND(cppcoreguidelines-macro-usage)
+constexpr size_t charSetSize = sizeof(CHARACTER_SET) - 1;
+
+} // namespace ext_lib
+
+#endif