Skip to content

Commit

Permalink
Tests - Add Basic KeyringTests
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Dec 8, 2023
1 parent d2c6d9a commit 0999401
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 61 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ if(BUILD_TESTING)
enable_testing()
add_executable(${PROJECT_NAME}_test
tests/eventtests.cpp
tests/keyringtests.cpp
tests/main.cpp
tests/networktests.cpp
tests/stringtests.cpp
Expand Down
61 changes: 0 additions & 61 deletions CMakePresets.json

This file was deleted.

18 changes: 18 additions & 0 deletions tests/keyringtests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <gtest/gtest.h>
#include <iostream>
#include "keyring/passwordgenerator.h"

using namespace Nickvision::Aura::Keyring;

TEST(KeyringTests, PasswordGen1)
{
PasswordGenerator gen;
std::string pass1 = gen.next();
std::string pass2 = gen.next();
std::string pass3 = gen.next(6);
std::count << pass1 << std::endl << pass2 << std::endl << pass3 << std::endl;
EXPECT_EQ(pass1.length(), 16);
EXPECT_EQ(pass2.length(), 16);
EXPECT_EQ(pass3.length(), 6);
EXPECT_FALSE(pass1 == pass2);
}

0 comments on commit 0999401

Please sign in to comment.