Skip to content

Commit 6c5ecf1

Browse files
committed
Refactor and release v0.1.1
1 parent 7cd1629 commit 6c5ecf1

5 files changed

Lines changed: 48 additions & 4 deletions

File tree

Java/library/src/test/java/org/jwitsml21parser/JWitsml21Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,6 @@ public void TestIntegrity() {
176176
public void testVersion() throws JWitsmlException, Exception {
177177
JWitsmlParser jWitsmlParser = new JWitsmlParser();
178178
assertNotNull(jWitsmlParser.getBsonVersion());
179-
assertEquals("0.1.0", jWitsmlParser.getBsonVersion().get("version"));
179+
assertEquals("0.1.1", jWitsmlParser.getBsonVersion().get("version"));
180180
}
181-
}
181+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ make >= 4.2.1
2626
git >= 2.25.1
2727
execstack >= 1.0 (for Java application)
2828
Java SDK development API (for Java application)
29+
Node JS >= v16.20.2 API (for Node JS)
2930
```
3031

3132
# Downloading

src/napi/addon.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct cws_js_err_t {
9696
char err[16];
9797
};
9898

99+
#ifdef WITH_STATISTICS
99100
#define SET_JS_CWS_UINT32_STAT(s) {#s, offsetof(struct statistics_t, s)}
100101
struct js_cws_uint32_stat_t {
101102
const char *name;
@@ -129,7 +130,7 @@ struct js_cws_uint64_stat_t {
129130

130131
#undef SET_JS_CWS_UINT64_STAT
131132
#undef SET_JS_CWS_UINT32_STAT
132-
133+
#endif
133134

134135
#define SET_JS_FN_CALL(fn) {#fn, c_##fn}
135136
typedef struct cws_js_fn_call_t {
@@ -168,6 +169,7 @@ struct cws_js_int32_t {
168169
{NULL}
169170
};
170171

172+
#ifdef WITH_STATISTICS
171173
static int cws_set_uint32_stat_list(napi_env env, napi_value exports, struct statistics_t *stat, struct js_cws_uint32_stat_t *list)
172174
{
173175
napi_value int32;
@@ -201,6 +203,7 @@ static int cws_set_uint64_stat_list(napi_env env, napi_value exports, struct sta
201203

202204
return 0;
203205
}
206+
#endif
204207

205208
static char *textBufAlloc(size_t *sz, struct js_cws_config_t *js_cws_config, size_t len)
206209
{
@@ -1067,6 +1070,7 @@ napi_value c_getJson(napi_env env, napi_callback_info info)
10671070
return res;
10681071
}
10691072

1073+
#ifdef WITH_STATISTICS
10701074
napi_value c_getStatistics(napi_env env, napi_callback_info info)
10711075
{
10721076
napi_value argv=NULL, res;
@@ -1119,6 +1123,7 @@ _Static_assert(sizeof(uint64_t)>=sizeof(size_t), "Archtecture error. Refactor it
11191123

11201124
return res;
11211125
}
1126+
#endif
11221127

11231128
napi_value c_getFaultString(napi_env env, napi_callback_info info)
11241129
{
@@ -1200,7 +1205,9 @@ CWS_JS_FUNCTIONS_OBJ CWS_JS_CREATE_FUNCTIONS[] = {
12001205
SET_JS_FN_CALL(getObjectType),
12011206
SET_JS_FN_CALL(getBsonBytes),
12021207
SET_JS_FN_CALL(getJson),
1208+
#ifdef WITH_STATISTICS
12031209
SET_JS_FN_CALL(getStatistics),
1210+
#endif
12041211
SET_JS_FN_CALL(getFaultString),
12051212
SET_JS_FN_CALL(getXMLfaultdetail),
12061213
SET_JS_FN_CALL(getError),

tests/C/pointers_assert.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@ void test_pointer_assert()
103103
CHECK_CFG_P(initial_resource_size, 0, NEQ)
104104

105105
test_pointer_assert_RELEASE((void *)&test_pointer_assert_rel);
106+
107+
C_ASSERT_NULL((void *)test_pointer_assert_rel.soap_internal, CTEST_SETTER(
108+
CTEST_TITLE("Testing soap_internal is NULL"),
109+
CTEST_INFO("Return value SHOULD be NULL"),
110+
CTEST_ON_SUCCESS("soap_internal pointer NULL SUCCESS")
111+
))
112+
113+
C_ASSERT_NULL((void *)test_pointer_assert_rel.config, CTEST_SETTER(
114+
CTEST_TITLE("Testing config is NULL"),
115+
CTEST_INFO("Return config value SHOULD be NULL"),
116+
CTEST_ON_SUCCESS("config pointer NULL SUCCESS")
117+
))
118+
119+
C_ASSERT_NULL((void *)test_pointer_assert_rel.text, CTEST_SETTER(
120+
CTEST_TITLE("Testing text is NULL"),
121+
CTEST_INFO("Return text value SHOULD be NULL"),
122+
CTEST_ON_SUCCESS("text pointer NULL SUCCESS")
123+
))
124+
106125
}
107126

108127
// TODO add tests in parsers and vectors internal_soap pointers

version.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
{
2-
"version": "0.1.0",
2+
"version": "0.1.1",
33
"witsmlVersion": "2.1",
44
"website": "https://github.com/devfabiosilva/witsml21parser",
55
"license": "MIT",
66
"author":"Fábio Pereira da Silva",
77
"contact_email": "fabioegel@gmail.com",
88
"pgp_pub_key_location": "https://github.com/devfabiosilva/witsml21parser/blob/master/fabioegel.asc",
99
"pgp_pub_key_fingerprint": "6E21 A6B6 E1A4 6580 CA00 FA54 1077 26E9 14B9 16A2",
10+
"modules": {
11+
"C": "yes",
12+
"C++": "yes",
13+
"Java": {
14+
"api": "1.8 or later",
15+
"hasStatistics": "yes",
16+
"hasJNI": "yes"
17+
},
18+
"NodeJS": {
19+
"api": "v16.20.2 or later",
20+
"hasStatistics": "yes"
21+
},
22+
"Python": {
23+
"api": "3.8 or later",
24+
"hasStatistics": "yes"
25+
}
26+
},
1027
"licenseInformation": "WARNING: Library dependencies are proprietary code. See each library dependences licenses",
1128
"dependencies": {
1229
"gSoap": {

0 commit comments

Comments
 (0)