diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-11-12 13:28:07 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-12 13:28:07 -0500 |
commit | a3dafd3f58bb3122b9de919e931c02b5e12373b2 (patch) | |
tree | 3df98129cf51f089d4edb734f55ea86f5b8e8e74 /src/test/test_checkdir.c | |
parent | 2170171d84e30bc4b1b2565255bd978668c50e97 (diff) | |
download | tor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.tar.gz tor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.zip |
Replace operators used as macro arguments with OP_XX macros
Part of fix for 13172
Diffstat (limited to 'src/test/test_checkdir.c')
-rw-r--r-- | src/test/test_checkdir.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/test/test_checkdir.c b/src/test/test_checkdir.c index 5135816270..6c520656e0 100644 --- a/src/test/test_checkdir.c +++ b/src/test/test_checkdir.c @@ -31,41 +31,41 @@ test_checkdir_perms(void *testdata) /* setup data directory before tests. */ tor_free(options->DataDirectory); options->DataDirectory = tor_strdup(get_fname(subdir)); - tt_int_op(mkdir(options->DataDirectory, 0750), ==, 0); + tt_int_op(mkdir(options->DataDirectory, 0750), OP_EQ, 0); /* test: create new dir, no flags. */ testdir = get_datadir_fname("checkdir_new_none"); cpd_chkopts = CPD_CREATE; unix_verify_optsmask = 0077; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); tor_free(testdir); /* test: create new dir, CPD_GROUP_OK option set. */ testdir = get_datadir_fname("checkdir_new_groupok"); cpd_chkopts = CPD_CREATE|CPD_GROUP_OK; unix_verify_optsmask = 0077; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); tor_free(testdir); /* test: should get an error on existing dir with wrong perms */ testdir = get_datadir_fname("checkdir_new_groupok_err"); - tt_int_op(0, ==, mkdir(testdir, 027)); + tt_int_op(0, OP_EQ, mkdir(testdir, 027)); cpd_chkopts = CPD_CHECK_MODE_ONLY|CPD_CREATE|CPD_GROUP_OK; - tt_int_op_nowin(-1, ==, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op_nowin(-1, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); tor_free(testdir); /* test: create new dir, CPD_GROUP_READ option set. */ testdir = get_datadir_fname("checkdir_new_groupread"); cpd_chkopts = CPD_CREATE|CPD_GROUP_READ; unix_verify_optsmask = 0027; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); tor_free(testdir); /* test: check existing dir created with defaults, @@ -75,10 +75,10 @@ test_checkdir_perms(void *testdata) unix_create_opts = 0700; (void)unix_create_opts; unix_verify_optsmask = 0077; - tt_int_op(0, ==, mkdir(testdir, unix_create_opts)); - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, mkdir(testdir, unix_create_opts)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); tor_free(testdir); /* test: check existing dir created with defaults, @@ -86,11 +86,11 @@ test_checkdir_perms(void *testdata) testdir = get_datadir_fname("checkdir_exists_groupok"); cpd_chkopts = CPD_CREATE; unix_verify_optsmask = 0077; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); cpd_chkopts = CPD_GROUP_OK; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); tor_free(testdir); /* test: check existing dir created with defaults, @@ -98,11 +98,11 @@ test_checkdir_perms(void *testdata) testdir = get_datadir_fname("checkdir_exists_groupread"); cpd_chkopts = CPD_CREATE; unix_verify_optsmask = 0027; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); cpd_chkopts = CPD_GROUP_READ; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); tor_free(testdir); /* test: check existing dir created with CPD_GROUP_READ, @@ -110,11 +110,11 @@ test_checkdir_perms(void *testdata) testdir = get_datadir_fname("checkdir_existsread_groupok"); cpd_chkopts = CPD_CREATE|CPD_GROUP_READ; unix_verify_optsmask = 0027; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); cpd_chkopts = CPD_GROUP_OK; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); tor_free(testdir); /* test: check existing dir created with CPD_GROUP_READ, @@ -122,9 +122,9 @@ test_checkdir_perms(void *testdata) testdir = get_datadir_fname("checkdir_existsread_groupread"); cpd_chkopts = CPD_CREATE|CPD_GROUP_READ; unix_verify_optsmask = 0027; - tt_int_op(0, ==, check_private_dir(testdir, cpd_chkopts, NULL)); - tt_int_op(0, ==, stat(testdir, &st)); - tt_int_op_nowin(0, ==, (st.st_mode & unix_verify_optsmask)); + tt_int_op(0, OP_EQ, check_private_dir(testdir, cpd_chkopts, NULL)); + tt_int_op(0, OP_EQ, stat(testdir, &st)); + tt_int_op_nowin(0, OP_EQ, (st.st_mode & unix_verify_optsmask)); done: tor_free(testdir); |