mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
Move gtest main, makefile improvements
* Move gtest main into separate file to keep testfiles clean. * Add explicit std=c++11 to support compilers where c++11 is not yet the default. * Remove -lssl because only crypto is needed
This commit is contained in:
4
Makefile
4
Makefile
@@ -7,9 +7,9 @@ OBJ = $(FSRC:=.o)
|
||||
DEP_DIR = .deps
|
||||
|
||||
FLAGS = -fPIC -Wall -Wno-unknown-pragmas -I include
|
||||
CXXFLAGS =
|
||||
CXXFLAGS = -std=c++11
|
||||
CFLAGS =
|
||||
LINKFLAGS = -lssl -lcrypto -lgtest
|
||||
LINKFLAGS = -lcrypto -lgtest -lpthread
|
||||
|
||||
OUTFILE = test
|
||||
|
||||
|
||||
7
TestMain.cpp
Normal file
7
TestMain.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
@@ -10,12 +10,6 @@ namespace {
|
||||
extern std::string ecdsa_pub_key_invalid;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
TEST(TokenTest, DecodeToken) {
|
||||
std::string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.AbIJTDMFc7yUa5MhvcP03nJPyCPzZtQcGEp-zWfOkEE";
|
||||
auto decoded = jwt::decode(token);
|
||||
|
||||
Reference in New Issue
Block a user