Merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-17 into lp:ubuntu-filemanager-app
- samba-actions-17
- Merge into trunk
Proposed by
Carlos Jose Mazieri
Status: | Merged |
---|---|
Approved by: | Arto Jalkanen |
Approved revision: | 448 |
Merged at revision: | 456 |
Proposed branch: | lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-17 |
Merge into: | lp:ubuntu-filemanager-app |
Prerequisite: | lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-16 |
Diff against target: |
706 lines (+681/-0) 2 files modified
src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.cpp (+658/-0) src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.h (+23/-0) |
To merge this branch: | bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-17 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Arto Jalkanen | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+265216@code.launchpad.net |
Commit message
Created Unit Tests for Samba Similar Qt Objects: SmbLocationItem
Description of the change
Created Unit Tests for Samba Similar Qt Objects in "qsambaclient" module.
To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
review:
Approve
(continuous-integration)
Revision history for this message
Arto Jalkanen (ajalkane) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.cpp' | |||
2 | --- src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.cpp 2015-07-19 16:44:54 +0000 | |||
3 | +++ src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.cpp 2015-07-19 16:44:54 +0000 | |||
4 | @@ -26,6 +26,8 @@ | |||
5 | 26 | #include "locationurl.h" | 26 | #include "locationurl.h" |
6 | 27 | #include "smbutil.h" | 27 | #include "smbutil.h" |
7 | 28 | #include "smblocationdiriterator.h" | 28 | #include "smblocationdiriterator.h" |
8 | 29 | #include "smblocationitemfile.h" | ||
9 | 30 | #include "smblocationitemdir.h" | ||
10 | 29 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
11 | 30 | #include <errno.h> | 32 | #include <errno.h> |
12 | 31 | 33 | ||
13 | @@ -726,3 +728,659 @@ | |||
14 | 726 | } | 728 | } |
15 | 727 | return true; | 729 | return true; |
16 | 728 | } | 730 | } |
17 | 731 | |||
18 | 732 | |||
19 | 733 | void TestQSambaSuite::unit_QFile_rename() | ||
20 | 734 | { | ||
21 | 735 | ShareCreationStatus share(createTempShare("unit_QFile_rename")); | ||
22 | 736 | if (share.tempDir) | ||
23 | 737 | { | ||
24 | 738 | share.tempDir->setAutoRemove(true); | ||
25 | 739 | } | ||
26 | 740 | QCOMPARE(share.status, true); | ||
27 | 741 | |||
28 | 742 | //negative tests | ||
29 | 743 | //empty object | ||
30 | 744 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
31 | 745 | QString newName("this_was_renamed.txt"); | ||
32 | 746 | QCOMPARE(fileNameEmptyDoesNotExist.rename(newName), false); | ||
33 | 747 | QCOMPARE(fileNameEmptyDoesNotExist.rename(QLatin1String(0), newName), false); | ||
34 | 748 | //orig file does not exist | ||
35 | 749 | QString nameDoesNotExist("_it_must_not_exist"); | ||
36 | 750 | SmbSharedPathAccess item = share.createPathForItem(nameDoesNotExist); | ||
37 | 751 | QFileInfo diskFileContent(item.diskPathname); | ||
38 | 752 | QCOMPARE(diskFileContent.exists(), false); | ||
39 | 753 | SmbLocationItemFile fileNameDoesNotExist(item.smbUrl); | ||
40 | 754 | QCOMPARE(fileNameDoesNotExist.rename(newName), false); | ||
41 | 755 | QCOMPARE(fileNameDoesNotExist.rename(nameDoesNotExist, newName), false); | ||
42 | 756 | |||
43 | 757 | //positive tests | ||
44 | 758 | SmbSharedPathAccess newItem = share.createPathForItem(newName); | ||
45 | 759 | QFileInfo newFileInfo(newItem.diskPathname); | ||
46 | 760 | //make sure target does not exist | ||
47 | 761 | QCOMPARE(newFileInfo.exists(), false); | ||
48 | 762 | //now rename | ||
49 | 763 | SmbLocationItemFile fileNameExists(share.fileContent.smbUrl); | ||
50 | 764 | QCOMPARE(fileNameExists.rename(newItem.smbUrl), true); | ||
51 | 765 | //now target must exist in local file system | ||
52 | 766 | QCOMPARE(newFileInfo.exists(), true); | ||
53 | 767 | diskFileContent.setFile(share.fileContent.diskPathname); | ||
54 | 768 | //make sure orignal file no longer exist | ||
55 | 769 | QCOMPARE(diskFileContent.exists(), false); | ||
56 | 770 | //now back to original name using an empty object | ||
57 | 771 | SmbLocationItemFile empty; | ||
58 | 772 | QCOMPARE(empty.rename(newItem.smbUrl, share.fileContent.smbUrl), true); | ||
59 | 773 | //make sure orignal exists again | ||
60 | 774 | QCOMPARE(diskFileContent.exists(), true); | ||
61 | 775 | } | ||
62 | 776 | |||
63 | 777 | |||
64 | 778 | void TestQSambaSuite::unit_QFile_remove() | ||
65 | 779 | { | ||
66 | 780 | ShareCreationStatus share(createTempShare("unit_QFile_remove")); | ||
67 | 781 | if (share.tempDir) | ||
68 | 782 | { | ||
69 | 783 | share.tempDir->setAutoRemove(true); | ||
70 | 784 | } | ||
71 | 785 | QCOMPARE(share.status, true); | ||
72 | 786 | |||
73 | 787 | //negative tests | ||
74 | 788 | //empty object | ||
75 | 789 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
76 | 790 | QCOMPARE(fileNameEmptyDoesNotExist.remove(), false); | ||
77 | 791 | //file name does not exist | ||
78 | 792 | SmbSharedPathAccess item = share.createPathForItem("_it_must_not_exist"); | ||
79 | 793 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
80 | 794 | SmbLocationItemFile fileNameDoesNotExist(item.smbUrl); | ||
81 | 795 | QCOMPARE(fileNameDoesNotExist.remove(), false); | ||
82 | 796 | QFileInfo diskFileInfo(share.fileContent.diskPathname); | ||
83 | 797 | // //now try to remove a file which does not have write permission | ||
84 | 798 | // QCOMPARE(diskFileInfo.exists(), true); | ||
85 | 799 | // QFile::Permissions originalPermissions = diskFileInfo.permissions(); | ||
86 | 800 | // QCOMPARE(QFile::setPermissions(share.fileContent.diskPathname, QFile::ReadOwner | QFile::ReadGroup | QFile::ReadOther), true); | ||
87 | 801 | // SmbLocationItemFile existentFileButNoWritePermission(share.fileContent.smbUrl); | ||
88 | 802 | // //remove must fail | ||
89 | 803 | // QCOMPARE(existentFileButNoWritePermission.remove(), false); | ||
90 | 804 | // QCOMPARE(errno, EPERM); | ||
91 | 805 | // QCOMPARE(QFile::setPermissions(share.fileContent.diskPathname, originalPermissions), true); | ||
92 | 806 | |||
93 | 807 | //positive test, remove fileContent | ||
94 | 808 | SmbLocationItemFile existentFile(share.fileContent.smbUrl); | ||
95 | 809 | SmbItemInfo smbExistentItem(share.fileContent.smbUrl); | ||
96 | 810 | QCOMPARE(smbExistentItem.exists(), true); | ||
97 | 811 | QCOMPARE(existentFile.remove(), true); | ||
98 | 812 | SmbItemInfo smbItem(share.fileContent.smbUrl); | ||
99 | 813 | //samba url for this file must not exist | ||
100 | 814 | QCOMPARE(smbItem.exists(), false); | ||
101 | 815 | //now origin file in file system must no longer exist | ||
102 | 816 | QCOMPARE(diskFileInfo.exists(), false); | ||
103 | 817 | } | ||
104 | 818 | |||
105 | 819 | |||
106 | 820 | void TestQSambaSuite::unit_QFile_open() | ||
107 | 821 | { | ||
108 | 822 | ShareCreationStatus share(createTempShare("unit_QFile_open")); | ||
109 | 823 | if (share.tempDir) | ||
110 | 824 | { | ||
111 | 825 | share.tempDir->setAutoRemove(true); | ||
112 | 826 | } | ||
113 | 827 | QCOMPARE(share.status, true); | ||
114 | 828 | |||
115 | 829 | //negative tests | ||
116 | 830 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
117 | 831 | QCOMPARE(fileNameEmptyDoesNotExist.open(QFile::WriteOnly), false); | ||
118 | 832 | SmbSharedPathAccess item = share.createPathForItem("_it_must_not_exist"); | ||
119 | 833 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
120 | 834 | SmbLocationItemFile fileNameDoesNotExist(item.smbUrl); | ||
121 | 835 | QCOMPARE(fileNameDoesNotExist.open(QFile::ReadOnly), false); | ||
122 | 836 | |||
123 | 837 | // ---- positive tests | ||
124 | 838 | //create a smb file using open | ||
125 | 839 | item = share.createPathForItem("now_it_must_be_created"); | ||
126 | 840 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
127 | 841 | SmbLocationItemFile fileCreated(item.smbUrl); | ||
128 | 842 | QCOMPARE(fileCreated.open(QFile::WriteOnly), true); | ||
129 | 843 | if (QFileInfo(item.diskPathname).exists() == false) | ||
130 | 844 | { | ||
131 | 845 | fileCreated.close(); // force to close if necessary | ||
132 | 846 | } | ||
133 | 847 | QCOMPARE(fileCreated.isOpen(), true); | ||
134 | 848 | //now check in the local disk to see if it was really created | ||
135 | 849 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
136 | 850 | //as QFile it closes itself in the destructor | ||
137 | 851 | } | ||
138 | 852 | |||
139 | 853 | |||
140 | 854 | void TestQSambaSuite::unit_QFile_read() | ||
141 | 855 | { | ||
142 | 856 | ShareCreationStatus share(createTempShare("unit_QFile_read")); | ||
143 | 857 | if (share.tempDir) | ||
144 | 858 | { | ||
145 | 859 | share.tempDir->setAutoRemove(true); | ||
146 | 860 | } | ||
147 | 861 | QCOMPARE(share.status, true); | ||
148 | 862 | |||
149 | 863 | //negative tests | ||
150 | 864 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
151 | 865 | char buffer[100]; | ||
152 | 866 | |||
153 | 867 | //get Qt read return when there is no file | ||
154 | 868 | qint64 qt_read_no_file = QFile().read(buffer, sizeof(buffer)); | ||
155 | 869 | |||
156 | 870 | QCOMPARE(fileNameEmptyDoesNotExist.read(buffer, sizeof(buffer)), qt_read_no_file); | ||
157 | 871 | SmbSharedPathAccess item = share.createPathForItem("_it_must_not_exist"); | ||
158 | 872 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
159 | 873 | SmbLocationItemFile fileMustNotExist(item.smbUrl); | ||
160 | 874 | QCOMPARE(fileMustNotExist.read(buffer, sizeof(buffer)), qt_read_no_file); | ||
161 | 875 | |||
162 | 876 | //positive test | ||
163 | 877 | //create a file in the local folder which is shared by Samba | ||
164 | 878 | item = share.createPathForItem("created_in_the_disk.txt"); | ||
165 | 879 | QFile inDisk(item.diskPathname); | ||
166 | 880 | QCOMPARE(inDisk.open(QFile::WriteOnly), true); | ||
167 | 881 | QByteArray diskContent("This a simple content used to test reading files from samba: "); | ||
168 | 882 | QByteArray initialDiskContent(diskContent); | ||
169 | 883 | QByteArray moreDiskContent(100, 'a'); | ||
170 | 884 | diskContent += moreDiskContent; | ||
171 | 885 | QCOMPARE(inDisk.write(diskContent), (qint64)diskContent.size()); | ||
172 | 886 | inDisk.close(); | ||
173 | 887 | //now read from Samba | ||
174 | 888 | SmbLocationItemFile existentFile(item.smbUrl); | ||
175 | 889 | QCOMPARE(existentFile.open(QFile::ReadOnly), true); | ||
176 | 890 | char smbBuffer [diskContent.size() + 100]; | ||
177 | 891 | //before first read | ||
178 | 892 | QCOMPARE(existentFile.atEnd(), false); | ||
179 | 893 | qint64 bytesRead = existentFile.read(smbBuffer, (qint64)initialDiskContent.size()); | ||
180 | 894 | qint64 expectedRead = (qint64)initialDiskContent.size(); | ||
181 | 895 | QCOMPARE(bytesRead, expectedRead); | ||
182 | 896 | QByteArray smbContent(smbBuffer,initialDiskContent.size()); | ||
183 | 897 | //compare the intial content | ||
184 | 898 | QCOMPARE(smbContent, initialDiskContent); | ||
185 | 899 | //before second read | ||
186 | 900 | QCOMPARE(existentFile.atEnd(), false); | ||
187 | 901 | expectedRead = (qint64) (diskContent.size() - initialDiskContent.size()); | ||
188 | 902 | //read remaining data in the file | ||
189 | 903 | bytesRead = existentFile.read(smbBuffer, expectedRead); | ||
190 | 904 | QCOMPARE(bytesRead, expectedRead); | ||
191 | 905 | QByteArray moreSmbContent(smbBuffer, expectedRead); | ||
192 | 906 | smbContent += moreSmbContent; | ||
193 | 907 | //now compare the whole content | ||
194 | 908 | QCOMPARE(smbContent, diskContent); | ||
195 | 909 | //now atEnd() must be true | ||
196 | 910 | QCOMPARE(existentFile.atEnd(), true); | ||
197 | 911 | } | ||
198 | 912 | |||
199 | 913 | |||
200 | 914 | void TestQSambaSuite::unit_QFile_write() | ||
201 | 915 | { | ||
202 | 916 | ShareCreationStatus share(createTempShare("unit_QFile_write")); | ||
203 | 917 | if (share.tempDir) | ||
204 | 918 | { | ||
205 | 919 | share.tempDir->setAutoRemove(true); | ||
206 | 920 | } | ||
207 | 921 | QCOMPARE(share.status, true); | ||
208 | 922 | |||
209 | 923 | //negative tests | ||
210 | 924 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
211 | 925 | QByteArray someContent("This is a simple content\n"); | ||
212 | 926 | //get Qt write return when there is no file | ||
213 | 927 | qint64 qt_write_no_file = QFile().write(someContent.constData(), (qint64)someContent.size()); | ||
214 | 928 | QCOMPARE(fileNameEmptyDoesNotExist.write(someContent.constData(), (qint64)someContent.size()), qt_write_no_file); | ||
215 | 929 | SmbSharedPathAccess item = share.createPathForItem("_it_must_not_exist"); | ||
216 | 930 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
217 | 931 | SmbLocationItemFile fileMustNotExist(item.smbUrl); | ||
218 | 932 | QCOMPARE(fileMustNotExist.write(someContent.constData(), (qint64)someContent.size()), qt_write_no_file); | ||
219 | 933 | |||
220 | 934 | //positive tests | ||
221 | 935 | //work with 2 items saving in Samba and saving in local file system | ||
222 | 936 | SmbSharedPathAccess items[2]; | ||
223 | 937 | items[0] = share.createPathForItem("first_item.txt"); | ||
224 | 938 | items[1] = share.createPathForItem("second_item.txt"); | ||
225 | 939 | QByteArray content; // starts empty | ||
226 | 940 | QFile::OpenMode openMode = QFile::WriteOnly; //after first write it receives Append mode | ||
227 | 941 | const int diskIndex = 0; | ||
228 | 942 | const int smbindex = 1; | ||
229 | 943 | QByteArray savedContent; | ||
230 | 944 | for(int counter = 0; counter < 4; ++counter, content += someContent) | ||
231 | 945 | { | ||
232 | 946 | QFile diskFile(items[diskIndex].diskPathname); | ||
233 | 947 | SmbLocationItemFile smbFile(items[smbindex].smbUrl); | ||
234 | 948 | //open both files | ||
235 | 949 | QCOMPARE(diskFile.open(openMode), true); | ||
236 | 950 | QCOMPARE(smbFile.open(openMode), true); | ||
237 | 951 | //first write should return 0 as content is empty | ||
238 | 952 | qint64 toSave = content.size(); | ||
239 | 953 | qint64 wrote = diskFile.write(content.constData(), toSave); | ||
240 | 954 | QCOMPARE(wrote, toSave); | ||
241 | 955 | wrote = smbFile.write(content.constData(), toSave); | ||
242 | 956 | QCOMPARE(wrote, toSave); | ||
243 | 957 | savedContent += content; | ||
244 | 958 | diskFile.close(); | ||
245 | 959 | smbFile.close(); | ||
246 | 960 | if (counter > 0) | ||
247 | 961 | { | ||
248 | 962 | openMode = QFile::Append; | ||
249 | 963 | } | ||
250 | 964 | } | ||
251 | 965 | //now check size and content | ||
252 | 966 | QFile diskFile(items[diskIndex].diskPathname); | ||
253 | 967 | SmbLocationItemFile smbFile(items[smbindex].smbUrl); | ||
254 | 968 | QCOMPARE(smbFile.size(), diskFile.size()); | ||
255 | 969 | QCOMPARE(diskFile.open(QFile::ReadOnly), true); | ||
256 | 970 | QCOMPARE(smbFile.open(QFile::ReadOnly), true); | ||
257 | 971 | //read file from disk, check the content | ||
258 | 972 | char buffer [1024]; | ||
259 | 973 | qint64 gotBytes = diskFile.read(buffer, sizeof(buffer)); | ||
260 | 974 | QCOMPARE((qint64)savedContent.size(), gotBytes); | ||
261 | 975 | QByteArray otherContent(buffer, (int)gotBytes); | ||
262 | 976 | QCOMPARE(otherContent, savedContent); | ||
263 | 977 | //read SMB file from disk, check the content | ||
264 | 978 | gotBytes = smbFile.read(buffer, sizeof(buffer)); | ||
265 | 979 | QCOMPARE((qint64)savedContent.size(), gotBytes); | ||
266 | 980 | otherContent.setRawData(buffer, (int)gotBytes); | ||
267 | 981 | QCOMPARE(otherContent, savedContent); | ||
268 | 982 | } | ||
269 | 983 | |||
270 | 984 | |||
271 | 985 | void TestQSambaSuite::unit_QFile_atEnd() | ||
272 | 986 | { | ||
273 | 987 | ShareCreationStatus share(createTempShare("unit_QFile_atEnd")); | ||
274 | 988 | if (share.tempDir) | ||
275 | 989 | { | ||
276 | 990 | share.tempDir->setAutoRemove(true); | ||
277 | 991 | } | ||
278 | 992 | QCOMPARE(share.status, true); | ||
279 | 993 | |||
280 | 994 | //negative tests | ||
281 | 995 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
282 | 996 | QCOMPARE(fileNameEmptyDoesNotExist.atEnd(), true); | ||
283 | 997 | SmbSharedPathAccess item = share.createPathForItem("_it_must_not_exist"); | ||
284 | 998 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
285 | 999 | SmbLocationItemFile fileMustNotExist(item.smbUrl); | ||
286 | 1000 | QCOMPARE(fileMustNotExist.atEnd(), true); | ||
287 | 1001 | QFileInfo fileContentInfo(share.fileContent.diskPathname); | ||
288 | 1002 | QCOMPARE(fileContentInfo.exists(), true); | ||
289 | 1003 | SmbLocationItemFile existentFile(share.fileContent.smbUrl); | ||
290 | 1004 | //first at end when file is still closed | ||
291 | 1005 | QCOMPARE(existentFile.atEnd(), true); | ||
292 | 1006 | QCOMPARE(existentFile.open(QFile::ReadOnly), true); | ||
293 | 1007 | char buffer [fileContentInfo.size()]; | ||
294 | 1008 | QCOMPARE(existentFile.read(buffer, (qint64)10), (qint64)10); | ||
295 | 1009 | //file is opened and not at end | ||
296 | 1010 | QCOMPARE(existentFile.atEnd(), false); | ||
297 | 1011 | QVERIFY(existentFile.read(buffer, fileContentInfo.size()) > 0); | ||
298 | 1012 | QCOMPARE(existentFile.atEnd(), true); | ||
299 | 1013 | } | ||
300 | 1014 | |||
301 | 1015 | |||
302 | 1016 | void TestQSambaSuite::unit_QFile_size() | ||
303 | 1017 | { | ||
304 | 1018 | ShareCreationStatus share(createTempShare("unit_QFile_size")); | ||
305 | 1019 | if (share.tempDir) | ||
306 | 1020 | { | ||
307 | 1021 | share.tempDir->setAutoRemove(true); | ||
308 | 1022 | } | ||
309 | 1023 | QCOMPARE(share.status, true); | ||
310 | 1024 | |||
311 | 1025 | //negative tests | ||
312 | 1026 | //empty objects | ||
313 | 1027 | qint64 qFile_size_for_disk = QFileInfo().size(); | ||
314 | 1028 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
315 | 1029 | QCOMPARE(fileNameEmptyDoesNotExist.size(), qFile_size_for_disk); | ||
316 | 1030 | //file does not exist | ||
317 | 1031 | SmbSharedPathAccess item = share.createPathForItem("it_must_not_exist.txt"); | ||
318 | 1032 | QFileInfo diskFileInfo(item.diskPathname); | ||
319 | 1033 | QCOMPARE(diskFileInfo.exists(), false); | ||
320 | 1034 | qFile_size_for_disk = diskFileInfo.size(); | ||
321 | 1035 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
322 | 1036 | SmbLocationItemFile fileMustNotExist(item.smbUrl); | ||
323 | 1037 | QCOMPARE(fileMustNotExist.size(), qFile_size_for_disk); | ||
324 | 1038 | |||
325 | 1039 | //positive tests | ||
326 | 1040 | diskFileInfo.setFile(share.fileContent.diskPathname); | ||
327 | 1041 | QCOMPARE(diskFileInfo.exists(), true); | ||
328 | 1042 | qFile_size_for_disk = diskFileInfo.size(); | ||
329 | 1043 | QVERIFY(qFile_size_for_disk > 0); | ||
330 | 1044 | SmbLocationItemFile existentFile(share.fileContent.smbUrl); | ||
331 | 1045 | //first time the file is closed | ||
332 | 1046 | QCOMPARE(existentFile.size(), qFile_size_for_disk); | ||
333 | 1047 | QCOMPARE(existentFile.open(QFile::ReadOnly), true); | ||
334 | 1048 | //second time the file is opened | ||
335 | 1049 | QCOMPARE(existentFile.size(), qFile_size_for_disk); | ||
336 | 1050 | //now append data using local file system | ||
337 | 1051 | QFile moreDataFile(share.fileContent.diskPathname); | ||
338 | 1052 | QCOMPARE(moreDataFile.open(QFile::Append), true); | ||
339 | 1053 | QByteArray moreData("just a more bytes"); | ||
340 | 1054 | QCOMPARE(moreDataFile.write(moreData), (qint64)moreData.size()); | ||
341 | 1055 | moreDataFile.close(); | ||
342 | 1056 | //other QFileInfo object to get new information | ||
343 | 1057 | QFileInfo newDiskFileInfo(share.fileContent.diskPathname); | ||
344 | 1058 | QVERIFY(newDiskFileInfo.size() > qFile_size_for_disk); // has more data now | ||
345 | 1059 | QCOMPARE(existentFile.size(), newDiskFileInfo.size()); | ||
346 | 1060 | } | ||
347 | 1061 | |||
348 | 1062 | |||
349 | 1063 | void TestQSambaSuite::unit_QFile_isOpen() | ||
350 | 1064 | { | ||
351 | 1065 | ShareCreationStatus share(createTempShare("unit_QFile_isOpen")); | ||
352 | 1066 | if (share.tempDir) | ||
353 | 1067 | { | ||
354 | 1068 | share.tempDir->setAutoRemove(true); | ||
355 | 1069 | } | ||
356 | 1070 | QCOMPARE(share.status, true); | ||
357 | 1071 | |||
358 | 1072 | //negative tests | ||
359 | 1073 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
360 | 1074 | QCOMPARE(fileNameEmptyDoesNotExist.isOpen(), false); | ||
361 | 1075 | SmbSharedPathAccess item = share.createPathForItem("_it_must_not_exist"); | ||
362 | 1076 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
363 | 1077 | SmbLocationItemFile fileMustNotExist(item.smbUrl); | ||
364 | 1078 | QCOMPARE(fileMustNotExist.isOpen(), false); | ||
365 | 1079 | |||
366 | 1080 | //positive tests | ||
367 | 1081 | SmbLocationDirIterator fileContentIterator(share.url, QDir::Files); | ||
368 | 1082 | QCOMPARE(fileContentIterator.hasNext(), true); | ||
369 | 1083 | fileContentIterator.next(); | ||
370 | 1084 | DirItemInfo iteminfo = fileContentIterator.fileInfo(); | ||
371 | 1085 | QCOMPARE(iteminfo.exists(), true); | ||
372 | 1086 | SmbLocationItemFile smbFile(iteminfo.urlPath()); | ||
373 | 1087 | QCOMPARE(smbFile.isOpen(), false); | ||
374 | 1088 | QCOMPARE(smbFile.open(QFile::ReadOnly), true); | ||
375 | 1089 | QCOMPARE(smbFile.isOpen(), true); | ||
376 | 1090 | } | ||
377 | 1091 | |||
378 | 1092 | |||
379 | 1093 | void TestQSambaSuite::unit_QFile_permissions() | ||
380 | 1094 | { | ||
381 | 1095 | ShareCreationStatus share(createTempShare("unit_QFile_permissions")); | ||
382 | 1096 | if (share.tempDir) | ||
383 | 1097 | { | ||
384 | 1098 | share.tempDir->setAutoRemove(true); | ||
385 | 1099 | } | ||
386 | 1100 | QCOMPARE(share.status, true); | ||
387 | 1101 | |||
388 | 1102 | //negative tests | ||
389 | 1103 | //empty objects | ||
390 | 1104 | QFile::Permissions qt_empty_permissions = QFileInfo().permissions(); | ||
391 | 1105 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
392 | 1106 | QCOMPARE(fileNameEmptyDoesNotExist.permissions(), qt_empty_permissions); | ||
393 | 1107 | //file does not exist | ||
394 | 1108 | SmbSharedPathAccess item = share.createPathForItem("it_must_not_exist.txt"); | ||
395 | 1109 | QFileInfo diskFileInfo(item.diskPathname); | ||
396 | 1110 | QCOMPARE(diskFileInfo.exists() ,false); | ||
397 | 1111 | SmbLocationItemFile fileNameDoesNotExist(item.smbUrl); | ||
398 | 1112 | QCOMPARE(fileNameDoesNotExist.permissions(), qt_empty_permissions); | ||
399 | 1113 | |||
400 | 1114 | //positive test, change in the local disk , check for permission in Samba | ||
401 | 1115 | QFile::Permissions perm_readOnly = QFile::ReadOwner | QFile::ReadGroup | QFile::ReadOther | QFile::ReadUser; | ||
402 | 1116 | |||
403 | 1117 | QFileInfo diskExistentFile(share.fileContent.diskPathname); | ||
404 | 1118 | QCOMPARE(diskExistentFile.exists(), true); | ||
405 | 1119 | //first make sure permissions are different | ||
406 | 1120 | QVERIFY(diskExistentFile.permissions() != perm_readOnly); | ||
407 | 1121 | //set permission using file in the local file system | ||
408 | 1122 | QCOMPARE(QFile::setPermissions(share.fileContent.diskPathname, perm_readOnly), true); | ||
409 | 1123 | //check the permission in the local file system | ||
410 | 1124 | QTest::qWait(100); | ||
411 | 1125 | QFile::Permissions curr_permissions = QFile(share.fileContent.diskPathname).permissions(); | ||
412 | 1126 | QCOMPARE(curr_permissions, perm_readOnly); | ||
413 | 1127 | //now the same permission must come using Samba | ||
414 | 1128 | SmbLocationItemFile smbExistentFile(share.fileContent.smbUrl); | ||
415 | 1129 | QFile::Permissions curr_smb_ermissions = smbExistentFile.permissions(); | ||
416 | 1130 | QCOMPARE(curr_smb_ermissions, perm_readOnly); | ||
417 | 1131 | } | ||
418 | 1132 | |||
419 | 1133 | |||
420 | 1134 | void TestQSambaSuite::unit_QFile_setPermissions() | ||
421 | 1135 | { | ||
422 | 1136 | ShareCreationStatus share(createTempShare("unit_QFile_setPermissions")); | ||
423 | 1137 | if (share.tempDir) | ||
424 | 1138 | { | ||
425 | 1139 | share.tempDir->setAutoRemove(true); | ||
426 | 1140 | } | ||
427 | 1141 | QCOMPARE(share.status, true); | ||
428 | 1142 | |||
429 | 1143 | //negative tests | ||
430 | 1144 | //empty objects | ||
431 | 1145 | QFile::Permissions qt_permissions = QFile::ReadOwner | QFile::ReadUser | QFile::WriteOwner | QFile::WriteUser; | ||
432 | 1146 | SmbLocationItemFile fileNameEmptyDoesNotExist; | ||
433 | 1147 | QCOMPARE(fileNameEmptyDoesNotExist.setPermissions(qt_permissions), false); | ||
434 | 1148 | //file does not exist | ||
435 | 1149 | SmbSharedPathAccess item = share.createPathForItem("it_must_not_exist.txt"); | ||
436 | 1150 | QFileInfo diskFileInfo(item.diskPathname); | ||
437 | 1151 | QCOMPARE(diskFileInfo.exists() ,false); | ||
438 | 1152 | SmbLocationItemFile fileNameDoesNotExist(item.smbUrl); | ||
439 | 1153 | QCOMPARE(fileNameDoesNotExist.setPermissions(qt_permissions), false); | ||
440 | 1154 | |||
441 | 1155 | QCOMPARE(fileNameDoesNotExist.setPermissions(share.fileContent.smbUrl, qt_permissions), true); | ||
442 | 1156 | SmbLocationItemFile smbFile(share.fileContent.smbUrl); | ||
443 | 1157 | QCOMPARE(smbFile.setPermissions(qt_permissions), true); | ||
444 | 1158 | } | ||
445 | 1159 | |||
446 | 1160 | |||
447 | 1161 | void TestQSambaSuite::unit_QDir_exists() | ||
448 | 1162 | { | ||
449 | 1163 | ShareCreationStatus share(createTempShare("unit_QDir_mkdir")); | ||
450 | 1164 | if (share.tempDir) | ||
451 | 1165 | { | ||
452 | 1166 | share.tempDir->setAutoRemove(true); | ||
453 | 1167 | } | ||
454 | 1168 | QCOMPARE(share.status, true); | ||
455 | 1169 | |||
456 | 1170 | //negative tests | ||
457 | 1171 | SmbLocationItemDir directoryEmptyName; | ||
458 | 1172 | QCOMPARE(directoryEmptyName.exists(), false); | ||
459 | 1173 | SmbSharedPathAccess item = share.createPathForItem("dirName"); | ||
460 | 1174 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
461 | 1175 | SmbLocationItemDir directoryDoesNotExist(item.smbUrl); | ||
462 | 1176 | QCOMPARE(directoryDoesNotExist.exists(), false); | ||
463 | 1177 | |||
464 | 1178 | //positve test | ||
465 | 1179 | //item.smbUrl does not exist, check above | ||
466 | 1180 | //create it in the disk | ||
467 | 1181 | QCOMPARE(QDir().mkpath(item.diskPathname), true); | ||
468 | 1182 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
469 | 1183 | SmbLocationItemDir directoyExists(item.smbUrl); | ||
470 | 1184 | QCOMPARE(directoyExists.exists(), true); | ||
471 | 1185 | } | ||
472 | 1186 | |||
473 | 1187 | |||
474 | 1188 | |||
475 | 1189 | |||
476 | 1190 | void TestQSambaSuite::unit_QDir_mkdir() | ||
477 | 1191 | { | ||
478 | 1192 | ShareCreationStatus share(createTempShare("unit_QDir_mkdir")); | ||
479 | 1193 | if (share.tempDir) | ||
480 | 1194 | { | ||
481 | 1195 | share.tempDir->setAutoRemove(true); | ||
482 | 1196 | } | ||
483 | 1197 | QCOMPARE(share.status, true); | ||
484 | 1198 | |||
485 | 1199 | //negative tests | ||
486 | 1200 | SmbLocationItemDir directoryDoesNotExist; | ||
487 | 1201 | QCOMPARE(directoryDoesNotExist.mkdir("relativeDir"), false); | ||
488 | 1202 | QCOMPARE(directoryDoesNotExist.mkdir("smb://localhost/share_does_not_exist"), false); | ||
489 | 1203 | QCOMPARE(directoryDoesNotExist.mkdir("smb://localhost/share_does_not_exist/invalid_share"), false); | ||
490 | 1204 | |||
491 | 1205 | //positive tests | ||
492 | 1206 | |||
493 | 1207 | //create relative directory | ||
494 | 1208 | QString relativeName("relativeDir"); | ||
495 | 1209 | SmbSharedPathAccess item = share.createPathForItem(relativeName); | ||
496 | 1210 | SmbLocationItemDir testRelative(share.url); | ||
497 | 1211 | SmbItemInfo smbDirBeforeCreation(item.smbUrl); | ||
498 | 1212 | //make sure directory does not exist | ||
499 | 1213 | QCOMPARE(smbDirBeforeCreation.exists(), false); | ||
500 | 1214 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
501 | 1215 | //create directory using Samba | ||
502 | 1216 | QCOMPARE(testRelative.mkdir(relativeName), true); | ||
503 | 1217 | //make sure it exists now | ||
504 | 1218 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
505 | 1219 | SmbItemInfo smbDirAfterCreation(item.smbUrl); | ||
506 | 1220 | QCOMPARE(smbDirAfterCreation.exists(), true); | ||
507 | 1221 | |||
508 | 1222 | //directory already exists, should return true | ||
509 | 1223 | QCOMPARE(testRelative.mkdir(relativeName), true); | ||
510 | 1224 | |||
511 | 1225 | //mkdir using absolute path | ||
512 | 1226 | item = share.createPathForItem("using_absolute_path"); | ||
513 | 1227 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
514 | 1228 | SmbLocationItemDir testAbsoluteDir; | ||
515 | 1229 | QCOMPARE(testAbsoluteDir.mkdir(item.smbUrl), true); | ||
516 | 1230 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
517 | 1231 | } | ||
518 | 1232 | |||
519 | 1233 | |||
520 | 1234 | |||
521 | 1235 | void TestQSambaSuite::unit_QDir_mkpath() | ||
522 | 1236 | { | ||
523 | 1237 | ShareCreationStatus share(createTempShare("unit_QDir_mkpath")); | ||
524 | 1238 | if (share.tempDir) | ||
525 | 1239 | { | ||
526 | 1240 | share.tempDir->setAutoRemove(true); | ||
527 | 1241 | } | ||
528 | 1242 | QCOMPARE(share.status, true); | ||
529 | 1243 | |||
530 | 1244 | //create multiple paths | ||
531 | 1245 | QStringList paths("path1"); | ||
532 | 1246 | paths.append("path2"); | ||
533 | 1247 | paths.append("path3"); | ||
534 | 1248 | //item will have smbUrl=smb://localhost/shareName/path1/path2/path3 and diskPathname=/tmp/tmpdir/path1/path2/path3 | ||
535 | 1249 | //using absolute path | ||
536 | 1250 | SmbSharedPathAccess item = share.createPathForItems(paths); | ||
537 | 1251 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
538 | 1252 | SmbLocationItemDir testAbsoluteDir; | ||
539 | 1253 | QCOMPARE(testAbsoluteDir.mkpath(item.smbUrl), true); | ||
540 | 1254 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
541 | 1255 | //test when it already exists | ||
542 | 1256 | QCOMPARE(testAbsoluteDir.mkpath(item.smbUrl), true); | ||
543 | 1257 | |||
544 | 1258 | //relative paths | ||
545 | 1259 | paths.clear(); | ||
546 | 1260 | paths.append("relative1"); | ||
547 | 1261 | paths.append("relative2"); | ||
548 | 1262 | item = share.createPathForItems(paths); | ||
549 | 1263 | SmbLocationItemDir relativeDir(share.url); | ||
550 | 1264 | QString multiplePaths = paths.join(QDir::separator()); | ||
551 | 1265 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
552 | 1266 | QCOMPARE(relativeDir.mkpath(multiplePaths), true); | ||
553 | 1267 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
554 | 1268 | } | ||
555 | 1269 | |||
556 | 1270 | |||
557 | 1271 | |||
558 | 1272 | void TestQSambaSuite::unit_QDir_rmdir() | ||
559 | 1273 | { | ||
560 | 1274 | ShareCreationStatus share(createTempShare("unit_QDir_rmdir")); | ||
561 | 1275 | if (share.tempDir) | ||
562 | 1276 | { | ||
563 | 1277 | share.tempDir->setAutoRemove(true); | ||
564 | 1278 | } | ||
565 | 1279 | QCOMPARE(share.status, true); | ||
566 | 1280 | |||
567 | 1281 | //negative tests | ||
568 | 1282 | SmbLocationItemDir directoryEmptyName; | ||
569 | 1283 | QCOMPARE(directoryEmptyName.rmdir("none"), false); | ||
570 | 1284 | QString dirName("dirName"); | ||
571 | 1285 | SmbSharedPathAccess item = share.createPathForItem(dirName); | ||
572 | 1286 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
573 | 1287 | SmbLocationItemDir directoryDoesNotExist(share.url); | ||
574 | 1288 | QCOMPARE(directoryDoesNotExist.rmdir(dirName), false); | ||
575 | 1289 | |||
576 | 1290 | //create a directory | ||
577 | 1291 | SmbLocationItemDir directory(share.url); | ||
578 | 1292 | //create using relative | ||
579 | 1293 | QCOMPARE(directory.mkdir(dirName), true); | ||
580 | 1294 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
581 | 1295 | //remove the relative directory | ||
582 | 1296 | QCOMPARE(directory.rmdir(dirName), true); | ||
583 | 1297 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
584 | 1298 | //create it again and now remove using absolute url | ||
585 | 1299 | QCOMPARE(directory.mkdir(dirName), true); | ||
586 | 1300 | QCOMPARE(QFileInfo(item.diskPathname).exists(), true); | ||
587 | 1301 | SmbLocationItemDir emptyObject; | ||
588 | 1302 | QCOMPARE(emptyObject.rmdir(item.smbUrl), true); | ||
589 | 1303 | QCOMPARE(QFileInfo(item.diskPathname).exists(), false); | ||
590 | 1304 | } | ||
591 | 1305 | |||
592 | 1306 | |||
593 | 1307 | void TestQSambaSuite::unit_QDirIterator_path() | ||
594 | 1308 | { | ||
595 | 1309 | ShareCreationStatus share(createTempShare("unit_QDirIterator_path")); | ||
596 | 1310 | if (share.tempDir) | ||
597 | 1311 | { | ||
598 | 1312 | share.tempDir->setAutoRemove(true); | ||
599 | 1313 | } | ||
600 | 1314 | QCOMPARE(share.status, true); | ||
601 | 1315 | QStringList paths = QStringList() << "path1" << "anotherPath" << "testdir" << "passThru" << "haha"; | ||
602 | 1316 | QStringList files = QStringList() << "text.txt" << "hiper.html" << "document.odf" << "spread.odx" << "tx.list"; | ||
603 | 1317 | |||
604 | 1318 | QStringList curPath; | ||
605 | 1319 | for (int counter=0; counter < paths.count() && counter < files.count(); ++counter) | ||
606 | 1320 | { | ||
607 | 1321 | curPath.append(paths.at(counter)); | ||
608 | 1322 | SmbSharedPathAccess item = share.createPathForItems(curPath); | ||
609 | 1323 | QCOMPARE(QDir().mkpath(item.diskPathname), true); | ||
610 | 1324 | QString fileFullPath = item.diskPathname + QDir::separator() + files.at(counter); | ||
611 | 1325 | QFile file(fileFullPath); | ||
612 | 1326 | QCOMPARE(file.open(QFile::WriteOnly), true); | ||
613 | 1327 | file.close(); | ||
614 | 1328 | } | ||
615 | 1329 | |||
616 | 1330 | QDir::Filters dirFilter = QDir::NoDotAndDotDot; | ||
617 | 1331 | QDir::Filters moreFilter[] = { QDir::AllEntries, QDir::Hidden, QDir::System }; | ||
618 | 1332 | |||
619 | 1333 | for (uint counter=0; counter < sizeof(moreFilter)/sizeof(moreFilter[0]); ++counter) | ||
620 | 1334 | { | ||
621 | 1335 | dirFilter |= moreFilter[counter]; | ||
622 | 1336 | QDirIterator dirIterator(share.sharedDirPath, dirFilter, QDirIterator::Subdirectories); | ||
623 | 1337 | SmbLocationDirIterator smbIterator(share.url, dirFilter, QDirIterator::Subdirectories); | ||
624 | 1338 | QStringList listDir; | ||
625 | 1339 | QStringList listSmb; | ||
626 | 1340 | qDebug() << "\n================="; | ||
627 | 1341 | while (dirIterator.hasNext() && smbIterator.hasNext()) | ||
628 | 1342 | { | ||
629 | 1343 | qDebug() << dirIterator.next() << smbIterator.next(); | ||
630 | 1344 | listDir.append(dirIterator.fileName()); | ||
631 | 1345 | listSmb.append(smbIterator.fileName()); | ||
632 | 1346 | } | ||
633 | 1347 | QCOMPARE(listDir, listSmb); | ||
634 | 1348 | } | ||
635 | 1349 | } | ||
636 | 1350 | |||
637 | 1351 | |||
638 | 1352 | void TestQSambaSuite::positive_statvfs() | ||
639 | 1353 | { | ||
640 | 1354 | ShareCreationStatus share(createTempShare("positive_statvfs")); | ||
641 | 1355 | if (share.tempDir) | ||
642 | 1356 | { | ||
643 | 1357 | share.tempDir->setAutoRemove(true); | ||
644 | 1358 | } | ||
645 | 1359 | QCOMPARE(share.status, true); | ||
646 | 1360 | |||
647 | 1361 | struct statvfs diskVfs; | ||
648 | 1362 | struct statvfs smbVfs; | ||
649 | 1363 | ::memset(&diskVfs, 0, sizeof(struct statvfs)); | ||
650 | 1364 | ::memset(&smbVfs, 0, sizeof(struct statvfs)); | ||
651 | 1365 | |||
652 | 1366 | //using a file that exists | ||
653 | 1367 | SmbUtil smb; | ||
654 | 1368 | QCOMPARE((int)smb.getStatvfsInfo(share.fileContent.smbUrl, &smbVfs), 0); | ||
655 | 1369 | QCOMPARE(::statvfs(share.fileContent.diskPathname.toLocal8Bit().constData(), &diskVfs), 0); | ||
656 | 1370 | QCOMPARE(smbVfs.f_blocks, diskVfs.f_blocks); | ||
657 | 1371 | QCOMPARE(smbVfs.f_ffree, diskVfs.f_ffree); | ||
658 | 1372 | QCOMPARE(smbVfs.f_files, diskVfs.f_files); | ||
659 | 1373 | QCOMPARE(smbVfs.f_bsize, diskVfs.f_bsize); | ||
660 | 1374 | QVERIFY( qAbs(smbVfs.f_bfree - diskVfs.f_bfree) < 10 ); | ||
661 | 1375 | |||
662 | 1376 | //using a directory | ||
663 | 1377 | ::memset(&diskVfs, 0, sizeof(struct statvfs)); | ||
664 | 1378 | ::memset(&smbVfs, 0, sizeof(struct statvfs)); | ||
665 | 1379 | QCOMPARE((int)smb.getStatvfsInfo(share.url, &smbVfs), 0); | ||
666 | 1380 | QCOMPARE(::statvfs(share.sharedDirPath.toLocal8Bit().constData(), &diskVfs), 0); | ||
667 | 1381 | QCOMPARE(smbVfs.f_blocks, diskVfs.f_blocks); | ||
668 | 1382 | QCOMPARE(smbVfs.f_ffree, diskVfs.f_ffree); | ||
669 | 1383 | QCOMPARE(smbVfs.f_files, diskVfs.f_files); | ||
670 | 1384 | QCOMPARE(smbVfs.f_bsize, diskVfs.f_bsize); | ||
671 | 1385 | QVERIFY( qAbs(smbVfs.f_bfree - diskVfs.f_bfree) < 10 ); | ||
672 | 1386 | } | ||
673 | 729 | 1387 | ||
674 | === modified file 'src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.h' | |||
675 | --- src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.h 2015-07-19 16:44:54 +0000 | |||
676 | +++ src/plugin/folderlistmodel/smb/qsambaclient/test/testqsambasuite.h 2015-07-19 16:44:54 +0000 | |||
677 | @@ -90,6 +90,29 @@ | |||
678 | 90 | void negative_emptyItemInfo(); | 90 | void negative_emptyItemInfo(); |
679 | 91 | void negative_dirIterator(); | 91 | void negative_dirIterator(); |
680 | 92 | 92 | ||
681 | 93 | private Q_SLOTS: //unit test for SmbLocationItemFile class | ||
682 | 94 | void unit_QFile_rename(); | ||
683 | 95 | void unit_QFile_remove(); | ||
684 | 96 | void unit_QFile_open(); | ||
685 | 97 | void unit_QFile_read(); | ||
686 | 98 | void unit_QFile_write(); | ||
687 | 99 | void unit_QFile_atEnd(); | ||
688 | 100 | void unit_QFile_size(); | ||
689 | 101 | void unit_QFile_isOpen(); | ||
690 | 102 | void unit_QFile_setPermissions(); | ||
691 | 103 | void unit_QFile_permissions(); | ||
692 | 104 | |||
693 | 105 | private Q_SLOTS: //unit test for SmbLocationItemDir class | ||
694 | 106 | void unit_QDir_exists(); | ||
695 | 107 | void unit_QDir_mkdir(); | ||
696 | 108 | void unit_QDir_mkpath(); | ||
697 | 109 | void unit_QDir_rmdir(); | ||
698 | 110 | |||
699 | 111 | private Q_SLOTS: //unit test for SmbLocationItemDirIterator class | ||
700 | 112 | void unit_QDirIterator_path(); | ||
701 | 113 | |||
702 | 114 | private Q_SLOTS: | ||
703 | 115 | void positive_statvfs(); | ||
704 | 93 | 116 | ||
705 | 94 | protected: | 117 | protected: |
706 | 95 | QString createTempFile(const QString& path, | 118 | QString createTempFile(const QString& path, |
PASSED: Continuous integration, rev:448 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 518/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 3103 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 3103/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- filemanager- app-utopic- amd64-ci/ 234 91.189. 93.70:8080/ job/ubuntu- filemanager- app-vivid- amd64-ci/ 140
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 518/rebuild
http://