Skip to content

Commit

Permalink
Fixing unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorka committed Apr 30, 2018
1 parent 236002d commit e03566f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build/test-lib-units.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export OPTION_RECOMPILE=yes # recompile before running test(s) (comment this lin
#export OPTION_TEST="MarkdownParserBenchmark.ParserMeta"

#export OPTION_TEST="AiNlpTestCase.AaUniverseBow"
export OPTION_TEST="AiNlpTestCase.AaRepositoryBow"
#export OPTION_TEST="AiNlpTestCase.AaRepositoryBow"
#export OPTION_TEST="AiNlpTestCase.Outline"
#export OPTION_TEST="AiNlpTestCase.Lexicon"
#export OPTION_TEST="AiNlpTestCase.Tokenizer"
Expand Down Expand Up @@ -66,7 +66,7 @@ export OPTION_TEST="AiNlpTestCase.AaRepositoryBow"
#export OPTION_TEST="MindTestCase.LearnAndRememberMindForgerRepository"
#export OPTION_TEST="DateTimeGearTestCase.Immutability"
#export OPTION_TEST="ConfigurationTestCase.*"
#export OPTION_TEST="ConfigurationTestCase.SaveDefaultConfig"
export OPTION_TEST="ConfigurationTestCase.SaveDefaultConfig"
#export OPTION_TEST="ConfigurationTestCase.SaveAndLoad"
##export OPTION_TEST="ConfigurationTestCase.FromConstructor"
#export OPTION_TEST="ConfigurationTestCase.Environment"
Expand Down
2 changes: 1 addition & 1 deletion lib/test/mindforger-lib-unit-tests.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2018-04-22T21:03:50. -->
<!-- Written by QtCreator 3.0.1, 2018-04-30T08:32:37. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
Expand Down
12 changes: 6 additions & 6 deletions lib/test/src/config/configuration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TEST(ConfigurationTestCase, SaveDefaultConfig)
string* asString = m8r::fileToString(file.getName());
EXPECT_NE(asString->find("Theme: light"), std::string::npos);
EXPECT_NE(asString->find("Time scope: 0y0m0d0h0m"), std::string::npos);
EXPECT_NE(asString->find("Show Notebook edit button: yes"), std::string::npos);
EXPECT_NE(asString->find("Editor syntax highlighting: yes"), std::string::npos);
EXPECT_NE(asString->find("Save reads metadata: yes"), std::string::npos);
EXPECT_NE(asString->find("Active repository: ~/mindforger-repository"), std::string::npos);
EXPECT_NE(asString->find("Repository: ~/mindforger-repository"), std::string::npos);
Expand All @@ -120,7 +120,7 @@ TEST(ConfigurationTestCase, SaveAndLoad)
string backupTheme = c.getUiThemeName();
m8r::TimeScope backupTimeScope = c.getTimeScope();
bool backupReadsMetadata = c.isSaveReadsMetadata();
bool backupNotebookButton = c.isUiShowNotebookEditButton();
bool backupNotebookButton = c.isUiEditorEnableSyntaxHighlighting();
m8r::Repository* backupActiveRepository;
if(c.isActiveRepository()) {
backupActiveRepository = c.getActiveRepository();
Expand All @@ -137,7 +137,7 @@ TEST(ConfigurationTestCase, SaveAndLoad)
m8r::TimeScope ts{1,2,33,4,55};
c.setTimeScope(ts);
c.setSaveReadsMetadata(false);
c.setUiShowNotebookEditButton(false);
c.setUiEditorEnableSyntaxHighlighting(false);
m8r::Repository* r = new m8r::Repository{
repositoryDir,
m8r::Repository::RepositoryType::MARKDOWN,
Expand All @@ -152,7 +152,7 @@ TEST(ConfigurationTestCase, SaveAndLoad)
string* asString = m8r::fileToString(c.getConfigFilePath());
EXPECT_NE(asString->find("Theme: CRAZYCOLORS"), std::string::npos);
EXPECT_NE(asString->find("Time scope: 1y2m33d4h55m"), std::string::npos);
EXPECT_NE(asString->find("Show Notebook edit button: no"), std::string::npos);
EXPECT_NE(asString->find("Editor syntax highlighting: no"), std::string::npos);
EXPECT_NE(asString->find("Save reads metadata: no"), std::string::npos);
EXPECT_NE(asString->find("Active repository: /tmp/custom-repository-single-file.md"), std::string::npos);
EXPECT_NE(asString->find("Repository: /tmp/custom-repository-single-file.md"), std::string::npos);
Expand All @@ -173,7 +173,7 @@ TEST(ConfigurationTestCase, SaveAndLoad)
c.getTimeScope().toString(timeScopeAsString);
EXPECT_EQ(timeScopeAsString, "1y2m33d4h55m");
EXPECT_FALSE(c.isSaveReadsMetadata());
EXPECT_FALSE(c.isUiShowNotebookEditButton());
EXPECT_FALSE(c.isUiEditorEnableSyntaxHighlighting());

EXPECT_GE(c.getRepositories().size(), 1);
EXPECT_NE(c.getRepositories().find(repositoryPath), c.getRepositories().end());
Expand All @@ -196,7 +196,7 @@ TEST(ConfigurationTestCase, SaveAndLoad)
c.setUiThemeName(backupTheme);
c.setTimeScope(backupTimeScope);
c.setSaveReadsMetadata(backupReadsMetadata);
c.setUiShowNotebookEditButton(backupNotebookButton);
c.setUiEditorEnableSyntaxHighlighting(backupNotebookButton);
if(backupActiveRepository) {
c.setActiveRepository(c.addRepository(backupActiveRepository));
} else {
Expand Down

0 comments on commit e03566f

Please sign in to comment.