Skip to content

Refactor librarybuilder, fix bugs, security, build system, and tests - #11

Merged
zjshermanburke merged 4 commits into
mainfrom
Development
Jun 7, 2026
Merged

Refactor librarybuilder, fix bugs, security, build system, and tests#11
zjshermanburke merged 4 commits into
mainfrom
Development

Conversation

@zjshermanburke

Copy link
Copy Markdown
Owner

Summary

  • Fix SQL injection, memory leaks, no-op delete_row, and Book.cpp set_sub_genre bug
  • Replace hardcoded database credentials with environment variables
  • Improve code quality: const references, Rule of Five, return by const reference
  • Add CMakeLists.txt build system with Google Test framework and coverage support
  • Add CI workflow for automated build and unit tests
  • Revert to exec_params for libpqxx compatibility with CI runner

Bugs Fixed

  • SQL injection → parameterized queries (exec_params)
  • Memory leaks in load_movie_collection/load_book_collection → stack variables
  • No-op delete_row → executes the query
  • Book.cpp set_sub_genre → assigns correct member

Security

  • Hardcoded credentials → environment variables via std::getenv

Code Quality

  • Pass-by-value strings → const std::string &
  • Getters return by const reference
  • Rule of Five for MovieCollection and BookCollection
  • Consistent & style (name-attached)

Build System

  • CMakeLists.txt with separate main and test executables
  • Test coverage support via lcov
  • Google Test framework with unit and integration tests
  • GitHub Actions CI workflow

Cleanup

  • Comments corrected (movie → book where appropriate)
  • Test includes removed from main.cpp
  • Table name validation helper

Zachary Sherman-Burke added 4 commits June 6, 2026 20:50
  Bugs fixed:
  - SQL injection → parameterized queries
  - Memory leaks → stack variables
  - No-op delete_row → executes the query
  - Book.cpp set_sub_genre → assigns correct member

  Security:
  - Hardcoded credentials → environment variables

  Code quality:
  - Pass-by-value strings → const std::string &
  - Getters return by const reference
  - Rule of Five for MovieCollection and BookCollection
  - Consistent & style (name-attached)

  Build system:
  - CMakeLists.txt with main and test targets
  - Test coverage support via lcov
  - Google Test framework
  - Separate test files per collection type

  Cleanup:
  - Comments corrected (movie → book where appropriate)
  - Test includes removed from main.cpp
  - Table name validation helper
@zjshermanburke
zjshermanburke merged commit 3608c3e into main Jun 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant