- Adjusted Formatting of tests
- Finished map implementation and unit tests TODO: Threading
This commit is contained in:
@@ -24,25 +24,20 @@
|
||||
|
||||
#include "../../test.h"
|
||||
|
||||
namespace fennec
|
||||
namespace fennec::test
|
||||
{
|
||||
|
||||
namespace test
|
||||
{
|
||||
inline void fennec_test_lang_bits()
|
||||
{
|
||||
int a = 0x48ef13ad;
|
||||
int b = 0x23e5ab9c;
|
||||
|
||||
inline void fennec_test_lang_bits()
|
||||
{
|
||||
int a = 0x48ef13ad;
|
||||
int b = 0x23e5ab9c;
|
||||
fennec_test_run(fennec::bit_cast<float>(0x3ee00000), 0.4375f);
|
||||
|
||||
fennec_test_run(fennec::bit_cast<float>(0x3ee00000), 0.4375f);
|
||||
|
||||
fennec_test_run(*static_cast<int*>(fennec::bit_and(&a, &b, sizeof(int))), 0x48ef13ad & 0x23e5ab9c);
|
||||
fennec_test_run(*static_cast<int*>(fennec::bit_or(&a, &b, sizeof(int))), (0x48ef13ad & 0x23e5ab9c) | 0x23e5ab9c);
|
||||
fennec_test_run(*static_cast<int*>(fennec::bit_xor(&a, &b, sizeof(int))), ((0x48ef13ad & 0x23e5ab9c) | 0x23e5ab9c) ^ 0x23e5ab9c);
|
||||
}
|
||||
|
||||
}
|
||||
fennec_test_run(*static_cast<int*>(fennec::bit_and(&a, &b, sizeof(int))), 0x48ef13ad & 0x23e5ab9c);
|
||||
fennec_test_run(*static_cast<int*>(fennec::bit_or(&a, &b, sizeof(int))), (0x48ef13ad & 0x23e5ab9c) | 0x23e5ab9c);
|
||||
fennec_test_run(*static_cast<int*>(fennec::bit_xor(&a, &b, sizeof(int))), ((0x48ef13ad & 0x23e5ab9c) | 0x23e5ab9c) ^ 0x23e5ab9c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,18 +19,13 @@
|
||||
#ifndef FENNEC_TEST_LANG_CONDITIONAL_TYPES_H
|
||||
#define FENNEC_TEST_LANG_CONDITIONAL_TYPES_H
|
||||
|
||||
namespace fennec
|
||||
namespace fennec::test
|
||||
{
|
||||
|
||||
namespace test
|
||||
{
|
||||
|
||||
inline void fennec_test_lang_conditional_types()
|
||||
{
|
||||
inline void fennec_test_lang_conditional_types()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,35 +22,30 @@
|
||||
#include <fennec/lang/hashing.h>
|
||||
#include "../../test.h"
|
||||
|
||||
namespace fennec
|
||||
namespace fennec::test
|
||||
{
|
||||
|
||||
namespace test
|
||||
{
|
||||
inline void fennec_test_lang_hashing() {
|
||||
|
||||
inline void fennec_test_lang_hashing() {
|
||||
size_t num = 61;
|
||||
float_t numf = bit_cast<float>((uint32_t)num);
|
||||
double_t numd = bit_cast<double>(num);
|
||||
size_t exp = hash<size_t>()(num);
|
||||
|
||||
size_t num = 61;
|
||||
float_t numf = bit_cast<float>((uint32_t)num);
|
||||
double_t numd = bit_cast<double>(num);
|
||||
size_t exp = hash<size_t>()(num);
|
||||
fennec_test_run(hash<int8_t>()(num), exp);
|
||||
fennec_test_run(hash<uint8_t>()(num), exp);
|
||||
fennec_test_run(hash<int16_t>()(num), exp);
|
||||
fennec_test_run(hash<uint16_t>()(num), exp);
|
||||
fennec_test_run(hash<int32_t>()(num), exp);
|
||||
fennec_test_run(hash<uint32_t>()(num), exp);
|
||||
fennec_test_run(hash<int64_t>()(num), exp);
|
||||
fennec_test_run(hash<uint64_t>()(num), exp);
|
||||
|
||||
fennec_test_run(hash<int8_t>()(num), exp);
|
||||
fennec_test_run(hash<uint8_t>()(num), exp);
|
||||
fennec_test_run(hash<int16_t>()(num), exp);
|
||||
fennec_test_run(hash<uint16_t>()(num), exp);
|
||||
fennec_test_run(hash<int32_t>()(num), exp);
|
||||
fennec_test_run(hash<uint32_t>()(num), exp);
|
||||
fennec_test_run(hash<int64_t>()(num), exp);
|
||||
fennec_test_run(hash<uint64_t>()(num), exp);
|
||||
fennec_test_spacer(1);
|
||||
|
||||
fennec_test_spacer(1);
|
||||
|
||||
fennec_test_run(hash<float_t>()(numf), exp);
|
||||
fennec_test_run(hash<double_t>()(numd), exp);
|
||||
}
|
||||
|
||||
}
|
||||
fennec_test_run(hash<float_t>()(numf), exp);
|
||||
fennec_test_run(hash<double_t>()(numd), exp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,22 +21,17 @@
|
||||
|
||||
#include <fennec/lang/sequences.h>
|
||||
|
||||
namespace fennec
|
||||
namespace fennec::test
|
||||
{
|
||||
|
||||
namespace test
|
||||
{
|
||||
inline void test_sequences()
|
||||
{
|
||||
static_assert(fennec::is_same_v<make_index_sequence_t<2>, index_sequence<0, 1>>);
|
||||
static_assert(fennec::is_same_v<make_index_sequence_t<3>, index_sequence<0, 1, 2>>);
|
||||
static_assert(fennec::is_same_v<make_index_sequence_t<4>, index_sequence<0, 1, 2, 3>>);
|
||||
|
||||
inline void test_sequences()
|
||||
{
|
||||
static_assert(fennec::is_same_v<make_index_sequence_t<2>, index_sequence<0, 1>>);
|
||||
static_assert(fennec::is_same_v<make_index_sequence_t<3>, index_sequence<0, 1, 2>>);
|
||||
static_assert(fennec::is_same_v<make_index_sequence_t<4>, index_sequence<0, 1, 2, 3>>);
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
}
|
||||
// TODO
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user