~voidraven/scry

scry/tests/test_scry.cpp -rw-r--r-- 1.5 KiB
15b8e799voidraven updated license 1 year, 14 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "scry.hpp"

TEST_CASE( "Empty password given", "[empty-pass]" ) {
  auto sp = std::make_unique<Scry>();
  REQUIRE( sp->make_key("", 4096, 8, 2) > 0 );
}

TEST_CASE( "Short password given", "[short-pass]" ) {
  auto sp = std::make_unique<Scry>();
  REQUIRE( sp->make_key("a", 4096, 8, 2) > 0 );
}

TEST_CASE( "Medium password given", "[medium-pass]" ) {
  auto sp = std::make_unique<Scry>();
  REQUIRE( sp->make_key("aaaaaaaaaa12341234", 4096, 8, 2) > 0 );
}

TEST_CASE( "Long password given", "[long-pass]" ) {
  auto sp = std::make_unique<Scry>();
  REQUIRE( sp->make_key("aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341!@#$%^&*()-=+\\|`~[]{};<>?", 4096, 8, 2) > 0 );
}

TEST_CASE( "Very long password given", "[short-pass]" ) {
  auto sp = std::make_unique<Scry>();
  REQUIRE( sp->make_key("aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341!@#$%^&*()-=\\+|`~[]{};<>?aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341234aaaaaaaaaa12341!@#$%^&*()-=+|`~[]{};<>?", 4096, 8, 2) > 0 );
}