Classes | Macros | Enumerations | Functions
test_flags.cpp File Reference
#include <catch2/catch.hpp>
#include <magic_enum/magic_enum.hpp>
#include <magic_enum/magic_enum_flags.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_flags.cpp:

Go to the source code of this file.

Classes

struct  magic_enum::customize::enum_range< Color >
 
struct  magic_enum::customize::enum_range< Directions >
 
struct  magic_enum::customize::enum_range< number >
 
struct  magic_enum::customize::enum_range< Numbers >
 

Macros

#define CATCH_CONFIG_MAIN
 

Enumerations

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  Directions : std::uint64_t {
  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  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,
  one = 1 << 1, two = 1 << 2, three = 1 << 3, Numbers::many = 1 << 30
}
 

Functions

 TEST_CASE ("bitwise_operators")
 
 TEST_CASE ("enum_cast")
 
 TEST_CASE ("enum_contains")
 
 TEST_CASE ("enum_count")
 
 TEST_CASE ("enum_entries")
 
 TEST_CASE ("enum_flags_name")
 
 TEST_CASE ("enum_flags_test")
 
 TEST_CASE ("enum_flags_test_any")
 
 TEST_CASE ("enum_index")
 
 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_value")
 
 TEST_CASE ("enum_values")
 
 TEST_CASE ("istream_operators")
 
 TEST_CASE ("ostream_operators")
 

Macro Definition Documentation

◆ CATCH_CONFIG_MAIN

#define CATCH_CONFIG_MAIN

Definition at line 32 of file test_flags.cpp.

Enumeration Type Documentation

◆ 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 46 of file test_flags.cpp.

◆ Directions

enum Directions : std::uint64_t
Enumerator
Up 
Down 
Right 
Left 
NoDirection 
Left 
Down 
Up 
Right 

Definition at line 64 of file test_flags.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 76 of file test_flags.cpp.

◆ Numbers

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

Definition at line 52 of file test_flags.cpp.

Function Documentation

◆ TEST_CASE() [1/19]

TEST_CASE ( "bitwise_operators"  )

Definition at line 611 of file test_flags.cpp.

◆ TEST_CASE() [2/19]

TEST_CASE ( "enum_cast"  )

Definition at line 100 of file test_flags.cpp.

◆ TEST_CASE() [3/19]

TEST_CASE ( "enum_contains"  )

Definition at line 222 of file test_flags.cpp.

◆ TEST_CASE() [4/19]

TEST_CASE ( "enum_count"  )

Definition at line 409 of file test_flags.cpp.

◆ TEST_CASE() [5/19]

TEST_CASE ( "enum_entries"  )

Definition at line 525 of file test_flags.cpp.

◆ TEST_CASE() [6/19]

TEST_CASE ( "enum_flags_name"  )

Definition at line 467 of file test_flags.cpp.

◆ TEST_CASE() [7/19]

TEST_CASE ( "enum_flags_test"  )

Definition at line 731 of file test_flags.cpp.

◆ TEST_CASE() [8/19]

TEST_CASE ( "enum_flags_test_any"  )

Definition at line 750 of file test_flags.cpp.

◆ TEST_CASE() [9/19]

TEST_CASE ( "enum_index"  )

Definition at line 186 of file test_flags.cpp.

◆ TEST_CASE() [10/19]

TEST_CASE ( "enum_name"  )

Definition at line 423 of file test_flags.cpp.

◆ TEST_CASE() [11/19]

TEST_CASE ( "enum_names"  )

Definition at line 509 of file test_flags.cpp.

◆ TEST_CASE() [12/19]

TEST_CASE ( "enum_next_value"  )

Definition at line 774 of file test_flags.cpp.

◆ TEST_CASE() [13/19]

TEST_CASE ( "enum_next_value_circular"  )

Definition at line 786 of file test_flags.cpp.

◆ TEST_CASE() [14/19]

TEST_CASE ( "enum_prev_value"  )

Definition at line 805 of file test_flags.cpp.

◆ TEST_CASE() [15/19]

TEST_CASE ( "enum_prev_value_circular"  )

Definition at line 817 of file test_flags.cpp.

◆ TEST_CASE() [16/19]

TEST_CASE ( "enum_value"  )

Definition at line 349 of file test_flags.cpp.

◆ TEST_CASE() [17/19]

TEST_CASE ( "enum_values"  )

Definition at line 393 of file test_flags.cpp.

◆ TEST_CASE() [18/19]

TEST_CASE ( "istream_operators"  )

Definition at line 581 of file test_flags.cpp.

◆ TEST_CASE() [19/19]

TEST_CASE ( "ostream_operators"  )

Definition at line 541 of file test_flags.cpp.



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