From 2a1bd22d18b4f6507b9a0253267681e687eff0cd Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 24 Sep 2023 17:05:56 +0800 Subject: [PATCH] update: upgrade md5sum library --- .gitmodules | 6 +++--- src/core_test/CMakeLists.txt | 8 ++++---- src/core_test/cases/all_cases.cc | 8 +++++--- third_party/md5 | 1 - third_party/md5sum | 1 + 5 files changed, 13 insertions(+), 11 deletions(-) delete mode 160000 third_party/md5 create mode 160000 third_party/md5sum diff --git a/.gitmodules b/.gitmodules index 67187a8..865ff83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ [submodule "third_party/googletest"] path = third_party/googletest url = https://github.com/google/googletest.git -[submodule "third_party/md5"] - path = third_party/md5 - url = https://github.com/ulwanski/md5.git [submodule "third_party/tiny_thread_pool"] path = third_party/tiny_thread_pool url = https://github.com/dnomd343/tiny_thread_pool.git [submodule "third_party/abseil-cpp"] path = third_party/abseil-cpp url = https://github.com/abseil/abseil-cpp.git +[submodule "third_party/md5sum"] + path = third_party/md5sum + url = https://github.com/dnomd343/md5sum.git diff --git a/src/core_test/CMakeLists.txt b/src/core_test/CMakeLists.txt index f8e9d42..7aa340e 100644 --- a/src/core_test/CMakeLists.txt +++ b/src/core_test/CMakeLists.txt @@ -6,15 +6,15 @@ include_directories(${KLOTSKI_ROOT_PATH}/third_party/googletest/googletest/inclu add_subdirectory(${KLOTSKI_ROOT_PATH}/third_party/googletest googletest EXCLUDE_FROM_ALL) #unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) -include_directories(${KLOTSKI_ROOT_PATH}/third_party/md5) -add_library(md5 STATIC ${KLOTSKI_ROOT_PATH}/third_party/md5/md5.cpp) +include_directories(${KLOTSKI_ROOT_PATH}/third_party/md5sum) +#add_library(md5 STATIC ${KLOTSKI_ROOT_PATH}/third_party/md5/md5.cpp) +add_subdirectory(${KLOTSKI_ROOT_PATH}/third_party/md5sum md5sum EXCLUDE_FROM_ALL) -set(KLOTSKI_TEST_DEPS klotski-core gtest gtest_main md5) +set(KLOTSKI_TEST_DEPS klotski-core gtest gtest_main md5sum) include_directories(${KLOTSKI_ROOT_PATH}/src/core/all_cases) include_directories(${KLOTSKI_ROOT_PATH}/src/core/utils) - add_executable(test_klotski_cases cases/all_cases.cc) target_link_libraries(test_klotski_cases PRIVATE ${KLOTSKI_TEST_DEPS}) add_test(NAME klotski_cases COMMAND test_klotski_cases) diff --git a/src/core_test/cases/all_cases.cc b/src/core_test/cases/all_cases.cc index addb4f2..c231396 100644 --- a/src/core_test/cases/all_cases.cc +++ b/src/core_test/cases/all_cases.cc @@ -3,7 +3,9 @@ #include #include "gtest/gtest.h" #include "all_cases.h" -#include "md5.h" +#include "md5sum.h" + +using md5::md5sum; using klotski::cases::AllCases; using klotski::cases::BasicRanges; @@ -46,7 +48,7 @@ TEST(Cases, basic_ranges_data) { asprintf(&tmp, "%08X\n", range); basic_ranges_str += tmp; } - EXPECT_EQ(md5(basic_ranges_str), BASIC_RANGES_MD5); + EXPECT_EQ(md5sum(basic_ranges_str), BASIC_RANGES_MD5); } TEST(Cases, all_cases_build) { @@ -85,5 +87,5 @@ TEST(Cases, all_cases_data) { all_cases_str += tmp; } } - EXPECT_EQ(md5(all_cases_str), ALL_CASES_MD5); + EXPECT_EQ(md5sum(all_cases_str), ALL_CASES_MD5); } diff --git a/third_party/md5 b/third_party/md5 deleted file mode 160000 index 2857560..0000000 --- a/third_party/md5 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2857560d6466c7b1a89da93a075ebadf6991783e diff --git a/third_party/md5sum b/third_party/md5sum new file mode 160000 index 0000000..d58aa1e --- /dev/null +++ b/third_party/md5sum @@ -0,0 +1 @@ +Subproject commit d58aa1e4eacff0e6086fe13ed435643b412d4c33