Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
1a572c8e
Commit
1a572c8e
authored
May 31, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for #1997; fixed build warnings
parent
6d498495
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
persistence.cpp
modules/core/src/persistence.cpp
+3
-2
test_misc.cpp
modules/core/test/test_misc.cpp
+18
-0
No files found.
modules/core/src/persistence.cpp
View file @
1a572c8e
...
@@ -268,7 +268,8 @@ static char* icvGets( CvFileStorage* fs, char* str, int maxCount )
...
@@ -268,7 +268,8 @@ static char* icvGets( CvFileStorage* fs, char* str, int maxCount )
{
{
if
(
fs
->
strbuf
)
if
(
fs
->
strbuf
)
{
{
size_t
i
=
fs
->
strbufpos
,
len
=
fs
->
strbufsize
,
j
=
0
;
size_t
i
=
fs
->
strbufpos
,
len
=
fs
->
strbufsize
;
int
j
=
0
;
const
char
*
instr
=
fs
->
strbuf
;
const
char
*
instr
=
fs
->
strbuf
;
while
(
i
<
len
&&
j
<
maxCount
-
1
)
while
(
i
<
len
&&
j
<
maxCount
-
1
)
{
{
...
@@ -2782,7 +2783,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
...
@@ -2782,7 +2783,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
int
xml_buf_size
=
1
<<
10
;
int
xml_buf_size
=
1
<<
10
;
char
substr
[]
=
"</opencv_storage>"
;
char
substr
[]
=
"</opencv_storage>"
;
int
last_occurence
=
-
1
;
int
last_occurence
=
-
1
;
xml_buf_size
=
MIN
(
xml_buf_size
,
file_size
);
xml_buf_size
=
MIN
(
xml_buf_size
,
int
(
file_size
)
);
fseek
(
fs
->
file
,
-
xml_buf_size
,
SEEK_END
);
fseek
(
fs
->
file
,
-
xml_buf_size
,
SEEK_END
);
xml_buf
=
(
char
*
)
cvAlloc
(
xml_buf_size
+
2
);
xml_buf
=
(
char
*
)
cvAlloc
(
xml_buf_size
+
2
);
// find the last occurence of </opencv_storage>
// find the last occurence of </opencv_storage>
...
...
modules/core/test/test_misc.cpp
View file @
1a572c8e
...
@@ -22,4 +22,21 @@ TEST(Core_Drawing, _914)
...
@@ -22,4 +22,21 @@ TEST(Core_Drawing, _914)
int
pixelsDrawn
=
rows
*
cols
-
countNonZero
(
img
);
int
pixelsDrawn
=
rows
*
cols
-
countNonZero
(
img
);
ASSERT_EQ
(
(
3
*
rows
+
cols
)
*
3
-
3
*
9
,
pixelsDrawn
);
ASSERT_EQ
(
(
3
*
rows
+
cols
)
*
3
-
3
*
9
,
pixelsDrawn
);
}
TEST
(
Core_OutputArraySreate
,
_1997
)
{
struct
local
{
static
void
create
(
OutputArray
arr
,
Size
submatSize
,
int
type
)
{
int
sizes
[]
=
{
submatSize
.
width
,
submatSize
.
height
};
arr
.
create
(
sizeof
(
sizes
)
/
sizeof
(
sizes
[
0
]),
sizes
,
type
);
}
};
Mat
mat
(
Size
(
512
,
512
),
CV_8U
);
Size
submatSize
=
Size
(
256
,
256
);
ASSERT_NO_THROW
(
local
::
create
(
mat
(
Rect
(
Point
(),
submatSize
)),
submatSize
,
mat
.
type
()
));
}
}
\ No newline at end of file
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