Initial Course

This commit is contained in:
David Gil de Gómez Pérez
2026-08-11 17:40:36 +03:00
commit 9aed1d1d86
202 changed files with 3420 additions and 0 deletions
@@ -0,0 +1,19 @@
#include "pointer_arithmetic.hpp"
#include <gtest/gtest.h>
TEST(PointerArithmetic, Distance) {
int data[] = {1, 2, 3, 4};
EXPECT_EQ(pointers::pointer_distance(data, data + 4), 4U);
}
TEST(PointerArithmetic, FindPointer) {
int data[] = {1, 2, 3};
EXPECT_EQ(pointers::find_pointer(data, data + 3, 2), data + 1);
}
TEST(PointerArithmetic, ReverseInPlace) {
int data[] = {1, 2, 3, 4};
pointers::reverse_in_place(data, data + 4);
EXPECT_EQ(data[0], 4);
EXPECT_EQ(data[3], 1);
}