Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
710ffdb4
Commit
710ffdb4
authored
6 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'upstream/develop' into develop
parents
c492d910
68a96ba5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/UnitTests/GUI/TestSaveService.h
+8
-7
8 additions, 7 deletions
Tests/UnitTests/GUI/TestSaveService.h
with
8 additions
and
7 deletions
Tests/UnitTests/GUI/TestSaveService.h
+
8
−
7
View file @
710ffdb4
...
...
@@ -16,7 +16,7 @@
class
TestSaveService
:
public
::
testing
::
Test
{
p
ublic
:
p
rotected
:
~
TestSaveService
();
// helper method to modify something in a model
...
...
@@ -25,6 +25,7 @@ public:
auto
instrument
=
models
->
instrumentModel
()
->
instrumentItem
();
instrument
->
setItemValue
(
InstrumentItem
::
P_IDENTIFIER
,
GUIHelpers
::
createUuid
());
}
const
int
m_save_wait
=
10000
;
};
TestSaveService
::~
TestSaveService
()
=
default
;
...
...
@@ -60,7 +61,7 @@ TEST_F(TestSaveService, test_autoSaveController)
// modify document once and check that autosave directory was created
modify_models
(
&
models
);
EXPECT_TRUE
(
document
->
isModified
());
EXPECT_TRUE
(
spyAutosave
.
wait
(
auto
save_
time
*
3
));
EXPECT_TRUE
(
spyAutosave
.
wait
(
m_
save_
wait
));
EXPECT_EQ
(
spyAutosave
.
count
(),
1
);
EXPECT_TRUE
(
ProjectUtils
::
exists
(
autosave
.
autosaveDir
()));
...
...
@@ -73,7 +74,7 @@ TEST_F(TestSaveService, test_autoSaveController)
for
(
size_t
i
=
0
;
i
<
10
;
++
i
)
modify_models
(
&
models
);
EXPECT_TRUE
(
spyAutosave
.
wait
(
auto
save_
time
*
3
));
EXPECT_TRUE
(
spyAutosave
.
wait
(
m_
save_
wait
));
EXPECT_EQ
(
spyAutosave
.
count
(),
2
);
// remove autosave dir
...
...
@@ -98,7 +99,7 @@ TEST_F(TestSaveService, test_autoSaveControllerNewDocument)
QSignalSpy
spyAutosave
(
&
autosave
,
SIGNAL
(
autosaveRequest
()));
modify_models
(
&
models
);
EXPECT_FALSE
(
spyAutosave
.
wait
(
autosave_time
*
3
));
EXPECT_FALSE
(
spyAutosave
.
wait
(
autosave_time
*
2
));
EXPECT_EQ
(
spyAutosave
.
count
(),
0
);
}
...
...
@@ -161,7 +162,7 @@ TEST_F(TestSaveService, test_saveServiceWithData)
service
.
setDocument
(
document
.
get
());
service
.
save
(
projectFileName
);
spySaveService
.
wait
(
100
);
// waiting saving in a thread is complete
spySaveService
.
wait
(
m_save_wait
);
// waiting saving in a thread is complete
EXPECT_EQ
(
spySaveService
.
count
(),
1
);
EXPECT_TRUE
(
ProjectUtils
::
exists
(
projectFileName
));
...
...
@@ -198,7 +199,7 @@ TEST_F(TestSaveService, test_autosaveEnabled)
QSignalSpy
spySaveService
(
&
service
,
SIGNAL
(
projectSaved
()));
service
.
save
(
projectFileName
);
spySaveService
.
wait
(
auto
save_
time
*
5
);
// waiting saving in a thread is complete
spySaveService
.
wait
(
m_
save_
wait
);
// waiting saving in a thread is complete
EXPECT_EQ
(
spySaveService
.
count
(),
1
);
EXPECT_FALSE
(
document
->
isModified
());
EXPECT_TRUE
(
ProjectUtils
::
exists
(
projectDir
+
"/document.pro"
));
...
...
@@ -211,7 +212,7 @@ TEST_F(TestSaveService, test_autosaveEnabled)
EXPECT_TRUE
(
document
->
isModified
());
spySaveService
.
wait
(
auto
save_
time
*
5
);
// waiting saving in a thread is complete
spySaveService
.
wait
(
m_
save_
wait
);
// waiting saving in a thread is complete
EXPECT_EQ
(
spySaveService
.
count
(),
1
);
EXPECT_TRUE
(
ProjectUtils
::
exists
(
projectDir
+
"/autosave/document.pro"
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment