Skip to content

Commit

Permalink
align sdk_test dir structure with sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
wwiv committed Dec 3, 2020
1 parent 246080d commit 868e960
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 51 deletions.
20 changes: 8 additions & 12 deletions sdk/net/ftn_msgdupe.h
Expand Up @@ -25,8 +25,7 @@
#include "sdk/fido/fido_address.h"
#include "sdk/fido/fido_packets.h"

namespace wwiv {
namespace sdk {
namespace wwiv::sdk {

#pragma pack(push, 1)
struct msgids {
Expand All @@ -45,24 +44,24 @@ class FtnMessageDupe final {
~FtnMessageDupe() = default;

[[nodiscard]] bool IsInitialized() const { return initialized_; }
std::string CreateMessageID(const wwiv::sdk::fido::FidoAddress& a);
bool add(const wwiv::sdk::fido::FidoPackedMessage& msg);
[[nodiscard]] std::string CreateMessageID(const fido::FidoAddress& a);
bool add(const fido::FidoPackedMessage& msg);
bool add(uint32_t header_crc32, uint32_t msgid_crc32);
bool remove(uint32_t header_crc32, uint32_t msgid_crc32);
/** returns true if either the header or msgid crc is duplicated */
[[nodiscard]] bool is_dupe(uint32_t header_crc32, uint32_t msgid_crc32) const;
[[nodiscard]] bool is_dupe(const wwiv::sdk::fido::FidoPackedMessage& msg) const;
[[nodiscard]] bool is_dupe(const fido::FidoPackedMessage& msg) const;

/** Returns the MSGID from this message or an empty string. */
static std::string GetMessageIDFromText(const std::string& text);
static bool GetMessageCrc32s(const wwiv::sdk::fido::FidoPackedMessage& msg,
[[nodiscard]] static std::string GetMessageIDFromText(const std::string& text);
static bool GetMessageCrc32s(const fido::FidoPackedMessage& msg,
uint32_t& header_crc32, uint32_t& msgid_crc32);

/**
* Returns the MSGID from this message in WWIV format
* (^D0MSGID vs. ^AMSGID) or an empty string.
*/
static std::string GetMessageIDFromWWIVText(const std::string& text);
[[nodiscard]] static std::string GetMessageIDFromWWIVText(const std::string& text);

private:
bool Load();
Expand All @@ -76,9 +75,6 @@ class FtnMessageDupe final {
bool use_filesystem_{true};
};


}
}


#endif // INCLUDED_SDK_FTN_MSGDUPE_H
#endif
72 changes: 36 additions & 36 deletions sdk_test/CMakeLists.txt
Expand Up @@ -3,42 +3,42 @@ include_directories(../deps/cereal/include)
include(GoogleTest)

set(test_sources
callout_test.cpp
chains_test.cpp
config_test.cpp
contact_test.cpp
datetime_test.cpp
email_test.cpp
fido_util_test.cpp
flo_test.cpp
ftn_msgdupe_test.cpp
msgapi_test.cpp
names_test.cpp
network_test.cpp
parsed_message_test.cpp
phone_numbers_test.cpp
qscan_test.cpp
sdk_helper.cpp
subxtr_test.cpp
type2_text_test.cpp
user_test.cpp
acs/acs_test.cpp
acs/ar_test.cpp
acs/expr_test.cpp
acs/value_test.cpp
ansi/ansi_test.cpp
ansi/framebuffer_test.cpp
ansi/makeansi_test.cpp
files/allow_test.cpp
files/dirs_test.cpp
files/diz_test.cpp
files/files_test.cpp
files/files_ext_test.cpp
files/tic_test.cpp
fido/fido_address_test.cpp
fido/nodelist_test.cpp
net/callouts_test.cpp
net/packets_test.cpp
"net/callout_test.cpp"
"chains_test.cpp"
"config_test.cpp"
"net/contact_test.cpp"
"datetime_test.cpp"
"msgapi/email_test.cpp"
"fido/fido_util_test.cpp"
"fido/flo_test.cpp"
"net/ftn_msgdupe_test.cpp"
"msgapi/msgapi_test.cpp"
"names_test.cpp"
"net/network_test.cpp"
"msgapi/parsed_message_test.cpp"
"phone_numbers_test.cpp"
"qscan_test.cpp"
"sdk_helper.cpp"
"subxtr_test.cpp"
"msgapi/type2_text_test.cpp"
"user_test.cpp"
"acs/acs_test.cpp"
"acs/ar_test.cpp"
"acs/expr_test.cpp"
"acs/value_test.cpp"
"ansi/ansi_test.cpp"
"ansi/framebuffer_test.cpp"
"ansi/makeansi_test.cpp"
"files/allow_test.cpp"
"files/dirs_test.cpp"
"files/diz_test.cpp"
"files/files_test.cpp"
"files/files_ext_test.cpp"
"files/tic_test.cpp"
"fido/fido_address_test.cpp"
"fido/nodelist_test.cpp"
"net/callouts_test.cpp"
"net/packets_test.cpp"
)
list(APPEND test_sources sdk_test_main.cpp)

Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion sdk_test/flo_test.cpp → sdk_test/fido/flo_test.cpp
Expand Up @@ -22,7 +22,6 @@
#include "core/textfile.h"
#include "core_test/file_helper.h"
#include "sdk/fido/flo_file.h"

#include "gtest/gtest.h"
#include <ctime>
#include <memory>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -22,18 +22,18 @@
#include "core/datetime.h"
#include "core/file.h"
#include "core/log.h"
#include "core/stl.h"
#include "core/strings.h"
#include "sdk/config.h"
#include "sdk/fido/fido_address.h"
#include "sdk/filenames.h"
#include "sdk/fido/fido_address.h"
#include "sdk/net/ftn_msgdupe.h"
#include "sdk_test/sdk_helper.h"
#include <cstdint>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include "core/stl.h"

using namespace std;

Expand Down
File renamed without changes.

0 comments on commit 868e960

Please sign in to comment.