retab everything to use tabs
This commit is contained in:
+12
-12
@@ -2,25 +2,25 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
enum animal {
|
||||
dog,
|
||||
cat,
|
||||
dog,
|
||||
cat,
|
||||
};
|
||||
|
||||
typedef struct args {
|
||||
enum animal animal;
|
||||
bool is_true;
|
||||
enum animal animal;
|
||||
bool is_true;
|
||||
} args_t;
|
||||
|
||||
#define ARGS_DEFAULT .animal=cat, .is_true=true
|
||||
#define ARGS(...) ((args_t){ ARGS_DEFAULT, __VA_ARGS__ })
|
||||
|
||||
Test(macro_magic, default_values) {
|
||||
args_t a1 = ARGS();
|
||||
args_t a2 = ARGS(.animal=dog);
|
||||
args_t a3 = ARGS(.animal=dog, .is_true=false);
|
||||
cr_assert_eq(a1.animal, cat);
|
||||
cr_assert_eq(a2.animal, dog);
|
||||
cr_assert_eq(a1.is_true, true);
|
||||
cr_assert_eq(a2.is_true, true);
|
||||
cr_assert_eq(a3.is_true, false);
|
||||
args_t a1 = ARGS();
|
||||
args_t a2 = ARGS(.animal=dog);
|
||||
args_t a3 = ARGS(.animal=dog, .is_true=false);
|
||||
cr_assert_eq(a1.animal, cat);
|
||||
cr_assert_eq(a2.animal, dog);
|
||||
cr_assert_eq(a1.is_true, true);
|
||||
cr_assert_eq(a2.is_true, true);
|
||||
cr_assert_eq(a3.is_true, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user