Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0230695a
Commit
0230695a
authored
Mar 27, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Mar 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/profile: Move GetPrivateProfileSectionA to its own test.
parent
2559440d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
profile.c
dlls/kernel32/tests/profile.c
+28
-7
No files found.
dlls/kernel32/tests/profile.c
View file @
0230695a
...
...
@@ -116,13 +116,6 @@ static void test_profile_string(void)
ok
(
ret
==
18
&&
!
strcmp
(
buf
,
"name1,name2,name4"
),
"wrong keys returned(%d): %s
\n
"
,
ret
,
buf
);
ret
=
GetPrivateProfileSectionA
(
"s"
,
buf
,
sizeof
(
buf
),
TESTFILE2
);
for
(
p
=
buf
+
strlen
(
buf
)
+
1
;
*
p
;
p
+=
strlen
(
p
)
+
1
)
p
[
-
1
]
=
','
;
/* and test */
ok
(
ret
==
35
&&
!
strcmp
(
buf
,
"name1=val1,name2=,name3,name4=val4"
),
"wrong section returned(%d): %s
\n
"
,
ret
,
buf
);
/* add a new key to test that the file is quite usable */
WritePrivateProfileStringA
(
"s"
,
"name5"
,
"val5"
,
TESTFILE2
);
ret
=
GetPrivateProfileStringA
(
"s"
,
NULL
,
""
,
buf
,
sizeof
(
buf
),
...
...
@@ -135,6 +128,33 @@ static void test_profile_string(void)
DeleteFileA
(
TESTFILE2
);
}
static
void
test_profile_sections
(
void
)
{
HANDLE
h
;
int
ret
;
DWORD
count
;
char
buf
[
100
];
char
*
p
;
static
const
char
content
[]
=
"[s]
\r\n
name1=val1
\r\n
name2=
\r\n
name3
\r\n
name4=val4
\r\n
"
;
static
const
char
testfile4
[]
=
".
\\
testwine4.ini"
;
DeleteFileA
(
testfile4
);
h
=
CreateFileA
(
testfile4
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
h
!=
INVALID_HANDLE_VALUE
,
" cannot create %s
\n
"
,
testfile4
);
if
(
h
==
INVALID_HANDLE_VALUE
)
return
;
WriteFile
(
h
,
content
,
sizeof
(
content
),
&
count
,
NULL
);
CloseHandle
(
h
);
ret
=
GetPrivateProfileSectionA
(
"s"
,
buf
,
sizeof
(
buf
),
testfile4
);
for
(
p
=
buf
+
strlen
(
buf
)
+
1
;
*
p
;
p
+=
strlen
(
p
)
+
1
)
p
[
-
1
]
=
','
;
/* and test */
ok
(
ret
==
35
&&
!
strcmp
(
buf
,
"name1=val1,name2=,name3,name4=val4"
),
"wrong section returned(%d): %s
\n
"
,
ret
,
buf
);
DeleteFileA
(
testfile4
);
}
static
void
test_profile_sections_names
(
void
)
{
HANDLE
h
;
...
...
@@ -205,5 +225,6 @@ START_TEST(profile)
{
test_profile_int
();
test_profile_string
();
test_profile_sections
();
test_profile_sections_names
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment