mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
src/ should only contain our code. Move the in-tree dependencies to dep/ This allows us (if necessary) to e.g. exclude that part of the tree from being analyzed by various tools or mark it as external code in IDEs.
15 lines
621 B
C++
15 lines
621 B
C++
#include <gtest/gtest.h>
|
|
#include "include/jwt-cpp/jwt.h"
|
|
|
|
TEST(TokenFormatTest, MissingDot) {
|
|
ASSERT_THROW(jwt::decode("eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0.eyJpc3MiOiJhdXRoMCJ9"), std::invalid_argument);
|
|
ASSERT_THROW(jwt::decode("eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0eyJpc3MiOiJhdXRoMCJ9."), std::invalid_argument);
|
|
}
|
|
|
|
TEST(TokenFormatTest, InvalidChar) {
|
|
ASSERT_THROW(jwt::decode("eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0().eyJpc3MiOiJhdXRoMCJ9."), std::runtime_error);
|
|
}
|
|
|
|
TEST(TokenFormatTest, InvalidJSON) {
|
|
ASSERT_THROW(jwt::decode("YXsiYWxnIjoibm9uZSIsInR5cCI6IkpXUyJ9YQ.eyJpc3MiOiJhdXRoMCJ9."), std::runtime_error);
|
|
} |