mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:27:43 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -19,10 +19,10 @@ struct SortableObject {
|
|||
int m_payload;
|
||||
};
|
||||
|
||||
static int compare_sortable_object(const void* a, const void* b)
|
||||
static int compare_sortable_object(void const* a, void const* b)
|
||||
{
|
||||
const int key1 = static_cast<const SortableObject*>(a)->m_key;
|
||||
const int key2 = static_cast<const SortableObject*>(b)->m_key;
|
||||
int const key1 = static_cast<SortableObject const*>(a)->m_key;
|
||||
int const key2 = static_cast<SortableObject const*>(b)->m_key;
|
||||
if (key1 < key2) {
|
||||
return -1;
|
||||
} else if (key1 == key2) {
|
||||
|
@ -60,16 +60,16 @@ TEST_CASE(quick_sort)
|
|||
qsort(test_objects.data(), test_objects.size(), sizeof(SortableObject), compare_sortable_object);
|
||||
// Check that the objects are sorted by key
|
||||
for (auto i = 0u; i + 1 < test_objects.size(); ++i) {
|
||||
const auto& key1 = test_objects[i].m_key;
|
||||
const auto& key2 = test_objects[i + 1].m_key;
|
||||
auto const& key1 = test_objects[i].m_key;
|
||||
auto const& key2 = test_objects[i + 1].m_key;
|
||||
if (key1 > key2) {
|
||||
FAIL(String::formatted("saw key {} before key {}\n", key1, key2));
|
||||
}
|
||||
}
|
||||
// Check that the object's payloads have not been corrupted
|
||||
for (auto i = 0u; i < test_objects.size(); ++i) {
|
||||
const auto expected = calc_payload_for_pos(i);
|
||||
const auto payload = test_objects[i].m_payload;
|
||||
auto const expected = calc_payload_for_pos(i);
|
||||
auto const payload = test_objects[i].m_payload;
|
||||
if (payload != expected) {
|
||||
FAIL(String::formatted("Expected payload {} for pos {}, got payload {}", expected, i, payload));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue