test: Add 8 and update 14 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 22s
Build-Test-Publish / build (linux/arm64) (push) Failing after 32s
Build-Test-Publish / create-manifest (push) Has been skipped

This commit is contained in:
Your Name
2025-08-10 21:18:40 +12:00
parent 1fed086348
commit 8ab6028597
22 changed files with 1392 additions and 81 deletions

21
testing/test_bcrypt.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include <iostream>
#include "../src/bcrypt.hpp"
using namespace simple_object_storage;
int main() {
std::string token = "test123";
std::string hash = BCrypt::hashPassword(token, 10);
std::cout << "Token: " << token << std::endl;
std::cout << "Hash: " << hash << std::endl;
bool valid = BCrypt::verifyPassword(token, hash);
std::cout << "Verification: " << (valid ? "VALID" : "INVALID") << std::endl;
// Test with wrong password
bool invalid = BCrypt::verifyPassword("wrong", hash);
std::cout << "Wrong password: " << (invalid ? "VALID" : "INVALID") << std::endl;
return valid ? 0 : 1;
}