1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2025-08-19 13:29:49 +00:00

Change namespace of kamokan-specific stuff.

This commit is contained in:
King_DuckZ 2017-06-12 22:57:40 +01:00
parent a912b1e3d4
commit e5f7f60e8b
32 changed files with 268 additions and 246 deletions

View file

@ -20,7 +20,7 @@
#include <utility>
#include <algorithm>
namespace tawashi {
namespace kamokan {
FakeStorage::FakeStorage (const Kakoune::SafePtr<SettingsBag>& parSettings, bool parItsConnected) :
Storage(parSettings),
m_submission_num(1),
@ -77,4 +77,4 @@ namespace tawashi {
const std::vector<FakeStorage::SubmittedPastie>& FakeStorage::submitted_pasties() const {
return m_submitted_pasties;
}
} //namespace tawashi
} //namespace kamokan

View file

@ -26,7 +26,7 @@
# error "Can't compile this class if test mode is disabled"
#endif
namespace tawashi {
namespace kamokan {
class FakeStorage : public Storage {
public:
struct SubmittedPastie {
@ -38,19 +38,19 @@ namespace tawashi {
};
FakeStorage (const Kakoune::SafePtr<SettingsBag>& parSettings, bool parItsConnected);
tawashi_virtual_testing ~FakeStorage();
kamokan_virtual_testing ~FakeStorage();
tawashi_virtual_testing void connect_async();
tawashi_virtual_testing bool is_connected() const;
tawashi_virtual_testing void finalize_connection();
tawashi_virtual_testing SubmissionResult submit_pastie (
kamokan_virtual_testing void connect_async();
kamokan_virtual_testing bool is_connected() const;
kamokan_virtual_testing void finalize_connection();
kamokan_virtual_testing SubmissionResult submit_pastie (
const boost::string_view& parText,
uint32_t parExpiry,
const boost::string_view& parLang,
const std::string& parRemoteIP
) const;
tawashi_virtual_testing boost::optional<std::string> retrieve_pastie (const boost::string_view& parToken) const;
kamokan_virtual_testing boost::optional<std::string> retrieve_pastie (const boost::string_view& parToken) const;
const std::vector<SubmittedPastie>& submitted_pasties() const;
@ -59,4 +59,4 @@ namespace tawashi {
mutable int64_t m_submission_num;
bool m_its_connected;
};
} //namespace tawashi
} //namespace kamokan

View file

@ -55,7 +55,7 @@ R"(Content-type: text/html
)";
} //unnamed namespace
namespace tawashi {
namespace kamokan {
class IndexResponseCustomMustache : public IndexResponse {
public:
IndexResponseCustomMustache (
@ -71,7 +71,7 @@ namespace tawashi {
return g_mustache_html;
}
};
} //namespace tawashi
} //namespace kamokan
TEST_CASE ("Index response", "[index][response]") {
using curry::SafeStackObject;
@ -109,12 +109,12 @@ TEST_CASE ("Index response", "[index][response]") {
" host_path = /\n"
" host_port =\n"
);
SafeStackObject<tawashi::IniFile> ini(std::move(kamokan_settings));
SafeStackObject<tawashi::SettingsBag> settings(ini, "kamokan");
SafeStackObject<kamokan::IniFile> ini(std::move(kamokan_settings));
SafeStackObject<kamokan::SettingsBag> settings(ini, "kamokan");
std::stringstream response_stream;
tawashi::IndexResponseCustomMustache response(settings, &response_stream, fake_env);
kamokan::IndexResponseCustomMustache response(settings, &response_stream, fake_env);
response.send();
response_stream.seekg(0);

View file

@ -29,7 +29,7 @@
#include <sstream>
#include <boost/lexical_cast.hpp>
namespace tawashi {
namespace kamokan {
class SubmitPasteResponseWithFakeStorage : public SubmitPasteResponse {
public:
SubmitPasteResponseWithFakeStorage (
@ -62,7 +62,7 @@ namespace tawashi {
FakeStorage m_fake_storage;
std::string m_post_data;
};
} //namespace tawashi
} //namespace kamokan
TEST_CASE ("Submit paste response", "[submitpaste][response]") {
using curry::SafeStackObject;
@ -121,11 +121,11 @@ TEST_CASE ("Submit paste response", "[submitpaste][response]") {
" min_pastie_size = 1\n"
" truncate_long_pasties = no\n"
);
SafeStackObject<tawashi::IniFile> ini(std::move(kamokan_settings));
SafeStackObject<tawashi::SettingsBag> settings(ini, "kamokan");
SafeStackObject<kamokan::IniFile> ini(std::move(kamokan_settings));
SafeStackObject<kamokan::SettingsBag> settings(ini, "kamokan");
std::ostringstream oss;
tawashi::SubmitPasteResponseWithFakeStorage submit_response(
kamokan::SubmitPasteResponseWithFakeStorage submit_response(
settings,
&oss,
fake_env,