Skip to content

Commit 0ebae1a

Browse files
committed
refactor(lib) remove parson from main dir and only used in test dirs
1 parent d32eba5 commit 0ebae1a

11 files changed

+5
-22
lines changed

bugsnag-plugin-android-ndk/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"dependencies": {
3-
"kgabis/parson": "0.0.0"
4-
},
52
"development": {
63
"silentbicycle/greatest": "v1.2.1"
74
}

bugsnag-plugin-android-ndk/src/main/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ add_library( # Specifies the name of the library.
2727
jni/utils/string.c
2828
jni/utils/threads.c
2929
jni/utils/memory.c
30-
jni/deps/parson/parson.c
3130
)
3231

3332
include_directories(

bugsnag-plugin-android-ndk/src/test/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ add_library(bugsnag-ndk-test SHARED
1414
cpp/test_featureflags.c
1515
cpp/test_bsg_event.c
1616
cpp/UnwindTest.cpp
17+
cpp/parson/parson.h
1718
)
1819
target_link_libraries(bugsnag-ndk-test bugsnag-ndk)

bugsnag-plugin-android-ndk/src/test/cpp/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#define GREATEST_FPRINTF(ignore, fmt, ...) \
77
__android_log_print(ANDROID_LOG_INFO, "BugsnagNDKTest", fmt, ##__VA_ARGS__)
88

9+
#include "parson/parson.h"
910
#include <greatest/greatest.h>
10-
#include <parson/parson.h>
1111

1212
#include "test_bsg_event.h"
1313
#include "test_serializer.h"

bugsnag-plugin-android-ndk/src/test/cpp/test_serializer.c

-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
#include <utils/string.h>
22
#include "test_serializer.h"
33

4-
enum greatest_test_res validate_serialized_json(const test_case *test_case,
5-
JSON_Value *event_val) {
6-
// convert to string
7-
char *serialized_string = json_serialize_to_string(event_val);
8-
json_value_free(event_val);
9-
10-
// validate structure
11-
char *expected = test_case->expected_json;
12-
ASSERT_STR_EQ(expected, serialized_string);
13-
PASS();
14-
}
15-
164
void loadUserTestCase(bugsnag_event *event) {
175
bugsnag_user *user = &event->user;
186
strcpy(user->name, "Fenton");

bugsnag-plugin-android-ndk/src/test/cpp/test_serializer.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <stdlib.h>
55

6-
#include <parson/parson.h>
6+
#include "parson/parson.h"
77

88
#include <utils/serializer.h>
99

@@ -12,8 +12,6 @@ typedef struct {
1212
char *expected_json;
1313
} test_case;
1414

15-
enum greatest_test_res validate_serialized_json(const test_case *test_case,
16-
JSON_Value *event_val);
1715
void loadUserTestCase(bugsnag_event *event);
1816
void loadAppTestCase(bugsnag_event *event);
1917
void loadAppMetadataTestCase(bugsnag_event *event);

bugsnag-plugin-android-ndk/src/test/cpp/test_utils_serialize.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include <stdlib.h>
33
#include <unistd.h>
44

5+
#include "parson/parson.h"
56
#include <greatest/greatest.h>
6-
#include <parson/parson.h>
77

88
#include <featureflags.h>
99
#include <utils/serializer.h>

scripts/audit-dependency-licenses.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
curl https://raw.githubusercontent.com/bugsnag/license-audit/master/config/decision_files/global.yml -o decisions.yml
44

55
license_finder --enabled-package-managers=gradle --decisions-file=decisions.yml
6-
license_finder --project-path=bugsnag-plugin-android-ndk/src/main/jni/deps/parson --enabled-package-managers=npm --decisions-file=decisions.yml
6+
license_finder --project-path=bugsnag-plugin-android-ndk/src/test/cpp/parson --enabled-package-managers=npm --decisions-file=decisions.yml

0 commit comments

Comments
 (0)