mirror of https://gitlab.com/cppit/jucipp
9 changed files with 117 additions and 54 deletions
@ -1,16 +0,0 @@ |
|||||||
#include "terminal.h" |
|
||||||
#include "info.h" |
|
||||||
#include <gtkmm.h> |
|
||||||
|
|
||||||
//In case one has to test functions that include Terminal::print or Info::print
|
|
||||||
//Requires display server to work
|
|
||||||
//However, it is possible to use the Broadway backend if the test is run in a pure terminal environment:
|
|
||||||
//broadwayd&
|
|
||||||
//make test
|
|
||||||
|
|
||||||
int main() { |
|
||||||
auto app=Gtk::Application::create(); |
|
||||||
Terminal::get().print("some message"); |
|
||||||
Info::get().print("some message"); |
|
||||||
g_assert(true); |
|
||||||
} |
|
||||||
@ -0,0 +1,43 @@ |
|||||||
|
#include <glib.h> |
||||||
|
#include "source.h" |
||||||
|
#include "filesystem.h" |
||||||
|
|
||||||
|
int filesystem::read(const std::string &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer) { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
int filesystem::read_non_utf8(const std::string &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer) { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
bool filesystem::write(const std::string &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
std::string hello_world=R"(#include <iostream> |
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::cout << "hello world\n";
|
||||||
|
})"; |
||||||
|
|
||||||
|
std::string hello_world_cleaned=R"(#include <iostream> |
||||||
|
|
||||||
|
int main() { |
||||||
|
std::cout << "hello world\n"; |
||||||
|
} |
||||||
|
)"; |
||||||
|
|
||||||
|
//Requires display server to work
|
||||||
|
//However, it is possible to use the Broadway backend if the test is run in a pure terminal environment:
|
||||||
|
//broadwayd&
|
||||||
|
//make test
|
||||||
|
|
||||||
|
int main() { |
||||||
|
auto app=Gtk::Application::create(); |
||||||
|
Gsv::init(); |
||||||
|
|
||||||
|
Source::View source_view("", Glib::RefPtr<Gsv::Language>()); |
||||||
|
source_view.get_buffer()->set_text(hello_world); |
||||||
|
source_view.cleanup_whitespace_characters(); |
||||||
|
g_assert(source_view.get_buffer()->get_text()==hello_world_cleaned); |
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
#include "selectiondialog.h" |
||||||
|
|
||||||
|
ListViewText::ListViewText(bool use_markup) {} |
||||||
|
|
||||||
|
SelectionDialogBase::SelectionDialogBase(Gtk::TextView& text_view, Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark, bool show_search_entry, bool use_markup): |
||||||
|
text_view(text_view), list_view_text(use_markup) {} |
||||||
|
|
||||||
|
void SelectionDialogBase::show() {} |
||||||
|
|
||||||
|
void SelectionDialogBase::hide() {} |
||||||
|
|
||||||
|
void SelectionDialogBase::add_row(const std::string& row) {} |
||||||
|
|
||||||
|
SelectionDialog::SelectionDialog(Gtk::TextView& text_view, Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark, bool show_search_entry, bool use_markup) : |
||||||
|
SelectionDialogBase(text_view, start_mark, show_search_entry, use_markup) {} |
||||||
|
|
||||||
|
SelectionDialogBase::~SelectionDialogBase() {} |
||||||
|
|
||||||
|
bool SelectionDialog::on_key_press(GdkEventKey* key) { return true; } |
||||||
|
bool CompletionDialog::on_key_press(GdkEventKey* key) { return true;} |
||||||
Loading…
Reference in new issue