From f741491272812ce20764eef0bcb1917beda3f309 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 11 Mar 2019 10:46:40 +0100 Subject: Use system-provided triehash --- triehash/tests/test-enum-include-name-flags | 129 ---------------------------- 1 file changed, 129 deletions(-) delete mode 100755 triehash/tests/test-enum-include-name-flags (limited to 'triehash/tests/test-enum-include-name-flags') diff --git a/triehash/tests/test-enum-include-name-flags b/triehash/tests/test-enum-include-name-flags deleted file mode 100755 index 33bd97c0f..000000000 --- a/triehash/tests/test-enum-include-name-flags +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh -. $(dirname $(readlink -f $0))/framework.sh - -# Need a short word, we really just need to check if the labels work -WORDS=w - -testsuccessequal "\ -#ifndef TRIE_HASH_PerfectHash -#define TRIE_HASH_PerfectHash -#include -#include -#include -enum PerfectKey { - w = 0, - Unknown = -1, -}; - enum PerfectKey PerfectHash(const char *string, size_t length); -#endif /* TRIE_HASH_PerfectHash */" triehash --multi-byte=0 -C /dev/null --include="" /dev/stdin - -# Check for --enum-class support -testsuccessequal "\ -#ifndef TRIE_HASH_PerfectHash -#define TRIE_HASH_PerfectHash -#include -#include -enum class PerfectKey { - w = 0, - Unknown = -1, -}; -static enum PerfectKey PerfectHash(const char *string, size_t length); -static enum PerfectKey PerfectHash1(const char *string) -{ - switch(string[0]) { - case 'w': - return PerfectKey::w; - } - return PerfectKey::Unknown; -} -static enum PerfectKey PerfectHash(const char *string, size_t length) -{ - switch (length) { - case 1: - return PerfectHash1(string); - default: - return PerfectKey::Unknown; - } -} -#endif /* TRIE_HASH_PerfectHash */" triehash --multi-byte=0 --enum-class /dev/stdin - -# Check for --enum-name support -testsuccessequal "\ -#ifndef TRIE_HASH_PerfectHash -#define TRIE_HASH_PerfectHash -#include -#include -enum Foo { - Unknown = -1, -}; -static enum Foo PerfectHash(const char *string, size_t length); -static enum Foo PerfectHash(const char *string, size_t length) -{ - switch (length) { - default: - return Unknown; - } -} -#endif /* TRIE_HASH_PerfectHash */\ -" triehash --multi-byte=0 --enum-name="Foo" - -# Check for --enum-class support -testsuccessequal "\ -#ifndef TRIE_HASH_PerfectHash -#define TRIE_HASH_PerfectHash -#include -#include -enum class Foo::Bar { - Unknown = -1, -}; -static enum Foo::Bar PerfectHash(const char *string, size_t length); -static enum Foo::Bar PerfectHash(const char *string, size_t length) -{ - switch (length) { - default: - return Foo::Bar::Unknown; - } -} -#endif /* TRIE_HASH_PerfectHash */\ -" triehash --multi-byte=0 --enum-class --enum-name="Foo::Bar" - -# Check for --function-name support -testsuccessequal "\ -#ifndef TRIE_HASH_NonSense -#define TRIE_HASH_NonSense -#include -#include -enum PerfectKey { - Unknown = -1, -}; -static enum PerfectKey NonSense(const char *string, size_t length); -static enum PerfectKey NonSense(const char *string, size_t length) -{ - switch (length) { - default: - return Unknown; - } -} -#endif /* TRIE_HASH_NonSense */\ -" triehash --multi-byte=0 --function-name="NonSense" - -# Check for --counter-name support -testsuccessequal "\ -#ifndef TRIE_HASH_PerfectHash -#define TRIE_HASH_PerfectHash -#include -#include -enum { MyCounter = 0 }; -enum PerfectKey { - Unknown = -1, -}; -static enum PerfectKey PerfectHash(const char *string, size_t length); -static enum PerfectKey PerfectHash(const char *string, size_t length) -{ - switch (length) { - default: - return Unknown; - } -} -#endif /* TRIE_HASH_PerfectHash */\ -" triehash --multi-byte=0 --counter-name="MyCounter" -- cgit v1.2.3