Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b40cd0ce
Commit
b40cd0ce
authored
Apr 09, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic unit test for URI decoding
parent
ef5c2337
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletion
+55
-1
src/Makefile.am
src/Makefile.am
+5
-1
src/test/url.c
src/test/url.c
+50
-0
No files found.
src/Makefile.am
View file @
b40cd0ce
...
@@ -385,7 +385,7 @@ stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
...
@@ -385,7 +385,7 @@ stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
# Unit/regression test
# Unit/regression test
###############################################################################
###############################################################################
if
USE_LIBTOOL
if
USE_LIBTOOL
check_PROGRAMS
=
test_i18n_atof
check_PROGRAMS
=
test_i18n_atof
test_url
TESTS
=
$(check_PROGRAMS)
TESTS
=
$(check_PROGRAMS)
CFLAGS_tests
=
`
$(VLC_CONFIG)
--cflags
vlc
`
CFLAGS_tests
=
`
$(VLC_CONFIG)
--cflags
vlc
`
...
@@ -393,5 +393,9 @@ CFLAGS_tests = `$(VLC_CONFIG) --cflags vlc`
...
@@ -393,5 +393,9 @@ CFLAGS_tests = `$(VLC_CONFIG) --cflags vlc`
test_i18n_atof_SOURCES
=
test
/i18n_atof.c
test_i18n_atof_SOURCES
=
test
/i18n_atof.c
test_i18n_atof_LDADD
=
libvlc.la
test_i18n_atof_LDADD
=
libvlc.la
test_i18n_atof_CFLAGS
=
$(CFLAGS_tests)
test_i18n_atof_CFLAGS
=
$(CFLAGS_tests)
test_url_SOURCES
=
test
/url.c
test_url_LDADD
=
libvlc.la
test_url_CFLAGS
=
$(CFLAGS_tests)
endif
endif
src/test/url.c
0 → 100644
View file @
b40cd0ce
/*****************************************************************************
* url.c: Test for url encoding/decoding stuff
*****************************************************************************
* Copyright (C) 2006 Rémi Denis-Courmont
* $Id$
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <vlc/vlc.h>
#include "vlc_url.h"
#undef NDEBUG
#include <assert.h>
int
main
(
void
)
{
const
char
url1
[]
=
"this_should_not_be_modified_1234"
;
const
char
url2
[]
=
"This+should+be+modified+1234!"
;
const
char
url3
[]
=
"This%20should%20be%20modified%201234!"
;
char
*
durl
=
decode_URI_duplicate
(
url1
);
assert
(
durl
!=
NULL
);
assert
(
!
strcmp
(
durl
,
url1
));
free
(
durl
);
durl
=
decode_URI_duplicate
(
url2
);
assert
(
durl
!=
NULL
);
assert
(
!
strcmp
(
durl
,
"This should be modified 1234!"
));
free
(
durl
);
durl
=
decode_URI_duplicate
(
url3
);
assert
(
durl
!=
NULL
);
assert
(
!
strcmp
(
durl
,
"This should be modified 1234!"
));
free
(
durl
);
return
0
;
}
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