From e3eaeca8e15c3dc5c3fe7d2ba281f805b25fa489 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 22:19:55 +0000 Subject: [PATCH 1/2] Add coverage for zaman::tkvm_h_v_d function Co-authored-by: gitmuhammedalbayrak <44205174+gitmuhammedalbayrak@users.noreply.github.com> --- Makefile | 22 +++++++----- include/XML/{Vakitler.xml => vakitler.xml} | 0 .../include-class/{Zaman.hpp => zaman.hpp} | 0 src/src-class/{Zaman.cpp => zaman.cpp} | 0 tests/test_zaman.cpp | 34 +++++++++++++++++++ 5 files changed, 47 insertions(+), 9 deletions(-) rename include/XML/{Vakitler.xml => vakitler.xml} (100%) rename include/include-class/{Zaman.hpp => zaman.hpp} (100%) rename src/src-class/{Zaman.cpp => zaman.cpp} (100%) create mode 100644 tests/test_zaman.cpp diff --git a/Makefile b/Makefile index 1900c75..4f33446 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,14 @@ -derle: topla -topla: main.o zaman.o pugi.o - g++ ./lib/main.o ./lib/zaman.o ./lib/pugi.o -o Vasati - -main.o: - g++ -I "./include" -c ./src/main.cpp -o ./lib/main.o -zaman.o: - g++ -I "./include" -c ./src/src-class/zaman.cpp -o ./lib/zaman.o -pugi.o: +derle: topla +topla: main.o zaman.o pugi.o + g++ ./lib/main.o ./lib/zaman.o ./lib/pugi.o -o Vasati + +test: topla + g++ -I "./include" tests/test_zaman.cpp ./lib/zaman.o ./lib/pugi.o -o tests/test_runner + ./tests/test_runner + +main.o: + g++ -I "./include" -c ./src/main.cpp -o ./lib/main.o +zaman.o: + g++ -I "./include" -c ./src/src-class/zaman.cpp -o ./lib/zaman.o +pugi.o: g++ -I "./include/packages/pugixml-1.9/src" -c ./include/packages/pugixml-1.9/src/pugixml.cpp -o ./lib/pugi.o \ No newline at end of file diff --git a/include/XML/Vakitler.xml b/include/XML/vakitler.xml similarity index 100% rename from include/XML/Vakitler.xml rename to include/XML/vakitler.xml diff --git a/include/include-class/Zaman.hpp b/include/include-class/zaman.hpp similarity index 100% rename from include/include-class/Zaman.hpp rename to include/include-class/zaman.hpp diff --git a/src/src-class/Zaman.cpp b/src/src-class/zaman.cpp similarity index 100% rename from src/src-class/Zaman.cpp rename to src/src-class/zaman.cpp diff --git a/tests/test_zaman.cpp b/tests/test_zaman.cpp new file mode 100644 index 0000000..9b197c8 --- /dev/null +++ b/tests/test_zaman.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include "include-class/zaman.hpp" + +void test_tkvm_h_v_d() { + zaman z; + + // Call the function explicitly + z.tkvm_h_v_d(); + + // Verify 'now' is properly set and within reasonable bounds + time_t current_time = time(0); + assert(z.now <= current_time); + assert(z.now >= current_time - 2); // allow small delay + + // Copy to avoid static buffer overwrites just in case + tm expected_ltm = *localtime(&z.now); + + assert(z.h_rakam_sene == (1900 + expected_ltm.tm_year)); + assert(z.h_rakam_ay == (1 + expected_ltm.tm_mon)); + assert(z.h_rakam_gun_ayin == expected_ltm.tm_mday); + assert(z.h_rakam_gun_senenin == (1 + expected_ltm.tm_yday)); + assert(z.h_rakam_gun_haftanin == expected_ltm.tm_wday); + + std::cout << "test_tkvm_h_v_d passed!" << std::endl; +} + +int main() { + std::cout << "Running tests..." << std::endl; + test_tkvm_h_v_d(); + std::cout << "All tests passed successfully." << std::endl; + return 0; +} From ff55901b626561cf8341e5303f82fcf6ddef9433 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 20:51:23 +0000 Subject: [PATCH 2/2] Resolve merge conflicts and fix test issues Co-authored-by: gitmuhammedalbayrak <44205174+gitmuhammedalbayrak@users.noreply.github.com> --- .gitignore | 4 ++++ Dockerfile | 9 +++++++++ Makefile | 6 ++++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b32957f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +Vasati +lib/ +*.o +tests/test_runner diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..289b88b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM gcc:latest + +WORKDIR /app + +COPY . . + +RUN make + +CMD ["./Vasati"] diff --git a/Makefile b/Makefile index 4f33446..7140fb9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -derle: topla +derle: init topla +init: + mkdir -p lib topla: main.o zaman.o pugi.o g++ ./lib/main.o ./lib/zaman.o ./lib/pugi.o -o Vasati @@ -11,4 +13,4 @@ main.o: zaman.o: g++ -I "./include" -c ./src/src-class/zaman.cpp -o ./lib/zaman.o pugi.o: - g++ -I "./include/packages/pugixml-1.9/src" -c ./include/packages/pugixml-1.9/src/pugixml.cpp -o ./lib/pugi.o \ No newline at end of file + g++ -I "./include/packages/pugixml-1.9/src" -c ./include/packages/pugixml-1.9/src/pugixml.cpp -o ./lib/pugi.o