Skip to content

[libc++][test] Cleanup LIBCPP_ONLY(meow_assert(...)) to LIBCPP_MEOW_ASSERT(...) #74967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void RunStringMoveTest(const fs::path::value_type* Expect) {
assert(p == Expect);
{
// Signature test
LIBCPP_ONLY(ASSERT_NOEXCEPT(p = std::move(ss)));
LIBCPP_ASSERT_NOEXCEPT(p = std::move(ss));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int, char**) {
typedef std::underlying_type<E>::type UT;
static_assert(!std::is_convertible<E, UT>::value, "");

LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned short>::value, "")); // Implementation detail
LIBCPP_STATIC_ASSERT(std::is_same<UT, unsigned short>::value, ""); // Implementation detail

typedef check_bitmask_type<E, E::skip_existing, E::update_existing> BitmaskTester;
assert(BitmaskTester::check());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int, char**) {
// Check that E is a scoped enum by checking for conversions.
typedef std::underlying_type<E>::type UT;
static_assert(!std::is_convertible<E, UT>::value, "");
LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned char>::value, ""));
LIBCPP_STATIC_ASSERT(std::is_same<UT, unsigned char>::value, "");

typedef check_bitmask_type<E, E::follow_directory_symlink, E::skip_permission_denied> BitmaskTester;
assert(BitmaskTester::check());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int, char**) {
typedef std::underlying_type<E>::type UT;
static_assert(!std::is_convertible<E, UT>::value, "");

LIBCPP_ONLY(static_assert(std::is_same<UT, signed char>::value, "")); // Implementation detail
LIBCPP_STATIC_ASSERT(std::is_same<UT, signed char>::value, ""); // Implementation detail

// The standard doesn't specify the numeric values of the enum.
LIBCPP_STATIC_ASSERT(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(int, char**) {
typedef std::underlying_type<E>::type UT;
static_assert(!std::is_convertible<E, UT>::value, "");

LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned char >::value, "")); // Implementation detail
LIBCPP_STATIC_ASSERT(std::is_same<UT, unsigned char >::value, ""); // Implementation detail

typedef check_bitmask_type<E, E::replace, E::nofollow> BitmaskTester;
assert(BitmaskTester::check());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int, char**) {
typedef std::underlying_type<E>::type UT;
static_assert(!std::is_convertible<E, UT>::value, "");

LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned >::value, "")); // Implementation detail
LIBCPP_STATIC_ASSERT(std::is_same<UT, unsigned >::value, ""); // Implementation detail

typedef check_bitmask_type<E, E::group_all, E::owner_all> BitmaskTester;
assert(BitmaskTester::check());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void basic_test()
assert(!ec);
assert(ret.is_absolute());
assert(PathEqIgnoreSep(ret, TC.expect));
LIBCPP_ONLY(assert(PathEq(ret, TC.expect)));
LIBCPP_ASSERT(PathEq(ret, TC.expect));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ static void test_exception_contains_paths()
} catch (filesystem_error const& err) {
assert(err.path1() == p);
// libc++ provides the current path as the second path in the exception
LIBCPP_ONLY(assert(err.path2() == current_path()));
LIBCPP_ASSERT(err.path2() == current_path());
}
fs::current_path(static_env.Dir);
try {
(void)canonical(p);
assert(false);
} catch (filesystem_error const& err) {
assert(err.path1() == p);
LIBCPP_ONLY(assert(err.path2() == static_env.Dir));
LIBCPP_ASSERT(err.path2() == static_env.Dir);
}
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void test_signatures()
ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr));
ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts));
ASSERT_NOEXCEPT(fs::permissions(p, pr, ec));
LIBCPP_ONLY(ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts, ec)));
LIBCPP_ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts, ec));
}

static void test_error_reporting()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void basic_tests()
PutEnv(TC.name, dne);
ec = GetTestEC();
ret = temp_directory_path(ec);
LIBCPP_ONLY(assert(ErrorIs(ec, expect_errc)));
LIBCPP_ASSERT(ErrorIs(ec, expect_errc));
assert(ec != GetTestEC());
assert(ec);
assert(ret == "");
Expand All @@ -104,7 +104,7 @@ static void basic_tests()
PutEnv(TC.name, file);
ec = GetTestEC();
ret = temp_directory_path(ec);
LIBCPP_ONLY(assert(ErrorIs(ec, expect_errc)));
LIBCPP_ASSERT(ErrorIs(ec, expect_errc));
assert(ec != GetTestEC());
assert(ec);
assert(ret == "");
Expand Down