Classes | Namespaces | Macros | Enumerations | Functions
test.cpp File Reference
#include <catch2/catch.hpp>
#include <magic_enum/magic_enum.hpp>
#include <magic_enum/magic_enum_fuse.hpp>
#include <magic_enum/magic_enum_iostream.hpp>
#include <magic_enum/magic_enum_utility.hpp>
#include <array>
#include <cctype>
#include <string_view>
#include <sstream>
Include dependency graph for test.cpp:

Go to the source code of this file.

Classes

struct  magic_enum::customize::enum_range< Binary >
 
struct  magic_enum::customize::enum_range< MaxUsedAsInvalid >
 
struct  magic_enum::customize::enum_range< number >
 
class  boo2::boo3::foo1
 
class  boo1::foo1
 
class  foo1
 
class  boo2::boo3::foo2
 
class  boo1::foo2
 
class  foo2
 

Namespaces

 boo1
 
 boo2
 
 boo2::boo3
 

Macros

#define CATCH_CONFIG_MAIN
 
#define MAGIC_ENUM_NO_CHECK_REFLECTED_ENUM
 
#define MAGIC_ENUM_RANGE_MAX   120
 
#define MAGIC_ENUM_RANGE_MIN   -120
 

Enumerations

enum  Binary : bool { Binary::ONE, Binary::TWO }
 
enum  BoolTest : bool { BoolTest::Yay, BoolTest::Nay }
 
enum  Color {
  Color::RED = -10, Color::BLUE = 0, Color::GREEN = 10, Color::RED = 1,
  Color::GREEN = 2, Color::BLUE = 4, Color::RED = 1, Color::GREEN = 2,
  Color::BLUE = 4, Color::RED = 1, Color::GREEN = 2, Color::BLUE = 4,
  Color::RED = -10, Color::BLUE = 0, Color::GREEN = 10, Color::RED,
  Color::BLUE, Color::GREEN, Color::RED = -12, Color::GREEN = 7,
  Color::BLUE = 15, Color::RED = 1, Color::GREEN = 2, Color::BLUE = 4,
  Color::RED = 1, Color::GREEN = 2, Color::BLUE = 4, Color::RED = 1,
  Color::GREEN = 2, Color::BLUE = 4, Color::RED = -12, Color::GREEN = 7,
  Color::BLUE = 15
}
 
enum  crc_hack { crc_hack::b5a7b602ab754d7ab30fb42c4fb28d82 }
 
enum  crc_hack_2 { crc_hack_2::b5a7b602ab754d7ab30fb42c4fb28d82, crc_hack_2::d19f2e9e82d14b96be4fa12b8a27ee9f }
 
enum  Directions {
  Up = 85, Down = -42, Right = 120, Left = -120,
  NoDirection = 0, Left = std::uint64_t{1} << 10, Down = std::uint64_t{1} << 20, Up = std::uint64_t{1} << 31,
  Right = std::uint64_t{1} << 63
}
 
enum  LargeNumbers { LargeNumbers::First = -1024, LargeNumbers::Second = 1024 }
 
enum  lt1 { s1, loooooooooooooooooooong1 }
 
enum  boo1::lt1 { boo1::s1, boo1::loooooooooooooooooooong1, boo1::s1, boo1::loooooooooooooooooooong1 }
 
enum  boo2::boo3::lt1 { boo2::boo3::s1, boo2::boo3::loooooooooooooooooooong1, boo2::boo3::s1, boo2::boo3::loooooooooooooooooooong1 }
 
enum  lt2 : unsigned { s2, loooooooooooooooooooong2 }
 
enum  boo1::lt2 : unsigned { boo1::s2, boo1::loooooooooooooooooooong2, boo1::s2, boo1::loooooooooooooooooooong2 }
 
enum  boo2::boo3::lt2 : unsigned { boo2::boo3::s2, boo2::boo3::loooooooooooooooooooong2, boo2::boo3::s2, boo2::boo3::loooooooooooooooooooong2 }
 
enum  lt3 { lt3::s3, lt3::loooooooooooooooooooong3 }
 
enum  boo1::lt3 { boo1::lt3::s3, boo1::lt3::loooooooooooooooooooong3 }
 
enum  boo2::boo3::lt3 { boo2::boo3::lt3::s3, boo2::boo3::lt3::loooooooooooooooooooong3 }
 
enum  lt4 : unsigned { lt4::s4, lt4::loooooooooooooooooooong4 }
 
enum  boo1::lt4 : unsigned { boo1::lt4::s4, boo1::lt4::loooooooooooooooooooong4 }
 
enum  boo2::boo3::lt4 : unsigned { boo2::boo3::lt4::s4, boo2::boo3::lt4::loooooooooooooooooooong4 }
 
enum  MaxUsedAsInvalid : std::uint8_t { MaxUsedAsInvalid::ONE, MaxUsedAsInvalid::TWO = 63, MaxUsedAsInvalid::INVALID = std::numeric_limits<std::uint8_t>::max() }
 
enum  number : unsigned long {
  one = 100, one = 1, two = 200, two,
  three = 300, three, four = 400, no_number = 0,
  one = 1 << 1, one = 1, one = 1 << 1, two = 1 << 2,
  two, two = 1 << 2, three = 1 << 3, three,
  three = 1 << 3, four = 1 << 4
}
 
enum  Numbers : int {
  Numbers::One, Numbers::Two, Numbers::Three, one = 1,
  two, three, Numbers::many = 127, Numbers::none = 0,
  Numbers::one = 1 << 1, Numbers::two = 1 << 2, Numbers::three = 1 << 3, Numbers::many = 1 << 30
}
 

Functions

template<Color C>
constexpr std::string_view DoWork ()
 
template<>
constexpr std::string_view DoWork< Color::GREEN > ()
 
 TEST_CASE ("bitwise_operators")
 
 TEST_CASE ("cmp_less")
 
 TEST_CASE ("enum_cast")
 
 TEST_CASE ("enum_contains")
 
 TEST_CASE ("enum_count")
 
 TEST_CASE ("enum_entries")
 
 TEST_CASE ("enum_for_each")
 
 TEST_CASE ("enum_index")
 
 TEST_CASE ("enum_integer")
 
 TEST_CASE ("enum_name")
 
 TEST_CASE ("enum_names")
 
 TEST_CASE ("enum_next_value")
 
 TEST_CASE ("enum_next_value_circular")
 
 TEST_CASE ("enum_prev_value")
 
 TEST_CASE ("enum_prev_value_circular")
 
 TEST_CASE ("enum_reflected")
 
 TEST_CASE ("enum_type_name")
 
 TEST_CASE ("enum_value")
 
 TEST_CASE ("enum_values")
 
 TEST_CASE ("extrema")
 
 TEST_CASE ("istream_operators")
 
 TEST_CASE ("ostream_operators")
 
 TEST_CASE ("type_traits")
 
 TEST_CASE ("valid_enum")
 

Macro Definition Documentation

◆ CATCH_CONFIG_MAIN

#define CATCH_CONFIG_MAIN

Definition at line 23 of file test.cpp.

◆ MAGIC_ENUM_NO_CHECK_REFLECTED_ENUM

#define MAGIC_ENUM_NO_CHECK_REFLECTED_ENUM

Definition at line 26 of file test.cpp.

◆ MAGIC_ENUM_RANGE_MAX

#define MAGIC_ENUM_RANGE_MAX   120

Definition at line 28 of file test.cpp.

◆ MAGIC_ENUM_RANGE_MIN

#define MAGIC_ENUM_RANGE_MIN   -120

Definition at line 27 of file test.cpp.

Enumeration Type Documentation

◆ Binary

enum Binary : bool
strong
Enumerator
ONE 
TWO 

Definition at line 92 of file test.cpp.

◆ BoolTest

enum BoolTest : bool
strong
Enumerator
Yay 
Nay 

Definition at line 102 of file test.cpp.

◆ Color

enum Color
strong
Enumerator
RED 
BLUE 
GREEN 
RED 
GREEN 
BLUE 
RED 
GREEN 
BLUE 
RED 
GREEN 
BLUE 
RED 
BLUE 
GREEN 
RED 
BLUE 
GREEN 
RED 
GREEN 
BLUE 
RED 
GREEN 
BLUE 
RED 
GREEN 
BLUE 
RED 
GREEN 
BLUE 
RED 
GREEN 
BLUE 

Definition at line 39 of file test.cpp.

◆ crc_hack

enum crc_hack
strong
Enumerator
b5a7b602ab754d7ab30fb42c4fb28d82 

Definition at line 72 of file test.cpp.

◆ crc_hack_2

enum crc_hack_2
strong
Enumerator
b5a7b602ab754d7ab30fb42c4fb28d82 
d19f2e9e82d14b96be4fa12b8a27ee9f 

Definition at line 76 of file test.cpp.

◆ Directions

enum Directions
Enumerator
Up 
Down 
Right 
Left 
NoDirection 
Left 
Down 
Up 
Right 

Definition at line 52 of file test.cpp.

◆ LargeNumbers

enum LargeNumbers
strong
Enumerator
First 
Second 

Definition at line 512 of file test.cpp.

◆ lt1

enum lt1
Enumerator
s1 
loooooooooooooooooooong1 

Definition at line 452 of file test.cpp.

◆ lt2

enum lt2 : unsigned
Enumerator
s2 
loooooooooooooooooooong2 

Definition at line 453 of file test.cpp.

◆ lt3

enum lt3
strong
Enumerator
s3 
loooooooooooooooooooong3 

Definition at line 454 of file test.cpp.

◆ lt4

enum lt4 : unsigned
strong
Enumerator
s4 
loooooooooooooooooooong4 

Definition at line 455 of file test.cpp.

◆ MaxUsedAsInvalid

enum MaxUsedAsInvalid : std::uint8_t
strong
Enumerator
ONE 
TWO 
INVALID 

Definition at line 81 of file test.cpp.

◆ number

enum number : unsigned long
Enumerator
one 
one 
two 
two 
three 
three 
four 
no_number 
one 
one 
one 
two 
two 
two 
three 
three 
three 
four 

Definition at line 54 of file test.cpp.

◆ Numbers

enum Numbers : int
strong
Enumerator
One 
Two 
Three 
one 
two 
three 
many 
none 
one 
two 
three 
many 

Definition at line 50 of file test.cpp.

Function Documentation

◆ DoWork()

template<Color C>
constexpr std::string_view DoWork ( )
constexpr

Definition at line 1065 of file test.cpp.

◆ DoWork< Color::GREEN >()

template<>
constexpr std::string_view DoWork< Color::GREEN > ( )
constexpr

Definition at line 1070 of file test.cpp.

◆ TEST_CASE() [1/24]

TEST_CASE ( "bitwise_operators"  )

Definition at line 755 of file test.cpp.

◆ TEST_CASE() [2/24]

TEST_CASE ( "cmp_less"  )

Definition at line 987 of file test.cpp.

◆ TEST_CASE() [3/24]

TEST_CASE ( "enum_cast"  )

Definition at line 108 of file test.cpp.

◆ TEST_CASE() [4/24]

TEST_CASE ( "enum_contains"  )

Definition at line 259 of file test.cpp.

◆ TEST_CASE() [5/24]

TEST_CASE ( "enum_count"  )

Definition at line 432 of file test.cpp.

◆ TEST_CASE() [6/24]

TEST_CASE ( "enum_entries"  )

Definition at line 678 of file test.cpp.

◆ TEST_CASE() [7/24]

TEST_CASE ( "enum_for_each"  )

Definition at line 1074 of file test.cpp.

◆ TEST_CASE() [8/24]

TEST_CASE ( "enum_index"  )

Definition at line 221 of file test.cpp.

◆ TEST_CASE() [9/24]

TEST_CASE ( "enum_integer"  )

Definition at line 187 of file test.cpp.

◆ TEST_CASE() [10/24]

TEST_CASE ( "enum_name"  )

Definition at line 517 of file test.cpp.

◆ TEST_CASE() [11/24]

TEST_CASE ( "enum_names"  )

Definition at line 662 of file test.cpp.

◆ TEST_CASE() [12/24]

TEST_CASE ( "enum_next_value"  )

Definition at line 1189 of file test.cpp.

◆ TEST_CASE() [13/24]

TEST_CASE ( "enum_next_value_circular"  )

Definition at line 1201 of file test.cpp.

◆ TEST_CASE() [14/24]

TEST_CASE ( "enum_prev_value"  )

Definition at line 1220 of file test.cpp.

◆ TEST_CASE() [15/24]

TEST_CASE ( "enum_prev_value_circular"  )

Definition at line 1232 of file test.cpp.

◆ TEST_CASE() [16/24]

TEST_CASE ( "enum_reflected"  )

Definition at line 1279 of file test.cpp.

◆ TEST_CASE() [17/24]

TEST_CASE ( "enum_type_name"  )

Definition at line 853 of file test.cpp.

◆ TEST_CASE() [18/24]

TEST_CASE ( "enum_value"  )

Definition at line 367 of file test.cpp.

◆ TEST_CASE() [19/24]

TEST_CASE ( "enum_values"  )

Definition at line 410 of file test.cpp.

◆ TEST_CASE() [20/24]

TEST_CASE ( "extrema"  )

Definition at line 913 of file test.cpp.

◆ TEST_CASE() [21/24]

TEST_CASE ( "istream_operators"  )

Definition at line 731 of file test.cpp.

◆ TEST_CASE() [22/24]

TEST_CASE ( "ostream_operators"  )

Definition at line 694 of file test.cpp.

◆ TEST_CASE() [23/24]

TEST_CASE ( "type_traits"  )

Definition at line 841 of file test.cpp.

◆ TEST_CASE() [24/24]

TEST_CASE ( "valid_enum"  )

Definition at line 1251 of file test.cpp.



magic_enum
Author(s):
autogenerated on Fri Feb 21 2025 03:20:19