Skip to content

Commit 4c64861

Browse files
authored
Merge pull request #58 from foodtiny/README.md
Fix NULL pointer in URL and update mock server in README.md
2 parents 8ae4a32 + 232ccbd commit 4c64861

5 files changed

Lines changed: 13 additions & 18 deletions

File tree

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@
2020
/test.txt
2121
/logging
2222
/json
23-
<<<<<<< HEAD
2423
/native.iml
25-
=======
26-
>>>>>>> 1ea982f7691a452fca8baefdc5ac09b6b142a8fc
24+

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ before_script:
1313
- sudo python misc/server.py &
1414
- cmake . -DCMAKE_BUILD_TYPE=debug -DCMAKE_VERBOSE_MAKEFILE=true
1515
script:
16-
- make native_test -j4
16+
- make native_test -j8
1717
- make unit-test
1818
after_script:
1919
- sudo pkill python

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Native Library
22

3-
[![Build Status](https://travis-ci.com/foodtiny/native.svg?token=p64HTBqDyw43Lh5iDLxP&branch=master)](https://travis-ci.com/foodtiny/native)
3+
[![Build Status](https://travis-ci.org/foodtiny/native.svg?token=p64HTBqDyw43Lh5iDLxP&branch=master)](https://travis-ci.com/foodtiny/native)
44
&nbsp;[![Support Platform](https://img.shields.io/badge/platform-linux%20%7C%20osx-blue.svg)]()&nbsp;&nbsp;[![License](https://img.shields.io/badge/license-apache-yellowgreen.svg)]()
55

66
**Native Library** provides low-level optimization and productivity for C/C++ application.
@@ -122,7 +122,7 @@ TEST(YourTestSuite, YourTestCase) {
122122
- At least one contributor in this project reviews your commits (except you) before merging
123123
- Best practices guidelines in [CONTRIBUTION.md](https://github.com/foodtiny/native/tree/master/CONTRIBUTION.md)
124124
125-
# Copyright & license
125+
### Copyright & license
126126
Copyright © 2014-2016 Food Tiny. All rights reserved, except as follows. Code is released under the Apache 2.0 license.
127127
You may obtain a duplicate copy of the same license, titled CC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/.
128128
Terms and conditions set forth in the file [LICENSE.docs](https://github.com/foodtiny/native/tree/master/LICENSE.docs).

java/net/URL/URL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ URL::URL(String spec) {
4343
this->port = number_default(url_port(url));
4444
this->query = string_default(http_query(url));
4545
this->path = string_default(http_path(url));
46+
free(url);
4647
}
4748

4849
URL::~URL() {}

java/net/URL/URLTest.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,21 @@ using namespace Java::Net;
3434
using namespace Java::Lang;
3535

3636
TEST (JavaNet, URLConstructor) {
37-
#ifdef __APPPLE__
38-
return;
39-
#endif
40-
4137
String urlString = "http://test.com:3000/file/test?param=1";
4238
URL url(urlString);
4339
ASSERT_STR("http", url.getProtocol().toString());
4440
ASSERT_STR("test.com", url.getHost().toString());
4541
ASSERT_EQUAL(3000, url.getPort());
4642
ASSERT_STR("/file/test", url.getPath().toString());
4743
ASSERT_STR("param=1", url.getQuery().toString());
48-
49-
urlString = "http://";
50-
url = URL(urlString);
51-
ASSERT_STR("", url.getProtocol().toString());
52-
ASSERT_STR("", url.getHost().toString());
53-
ASSERT_STR("", url.getPath().toString());
54-
ASSERT_STR("", url.getQuery().toString());
55-
ASSERT_EQUAL(-1, url.getPort());
44+
45+
String urlString2 = "http://";
46+
URL url2(urlString2);
47+
ASSERT_STR("", url2.getProtocol().toString());
48+
ASSERT_STR("", url2.getHost().toString());
49+
ASSERT_STR("", url2.getPath().toString());
50+
ASSERT_STR("", url2.getQuery().toString());
51+
ASSERT_EQUAL(-1, url2.getPort());
5652
}
5753

5854
TEST (JavaNet, URLToString) {

0 commit comments

Comments
 (0)