summaryrefslogtreecommitdiff
path: root/auto_tests/file_saving_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-01-20 19:47:46 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-01-21 00:14:43 +0000
commit822dd2fac282c5c92c3bb8dc42a190e47d93d9c7 (patch)
treee46e0c25fd85613420b8984d2de96aa219cef958 /auto_tests/file_saving_test.c
parent98febe0589db3f6fedba03bfdc1d246f723d2f25 (diff)
Don't allocate or dereference Tox_Options in tests.
This struct will soon become opaque.
Diffstat (limited to 'auto_tests/file_saving_test.c')
-rw-r--r--auto_tests/file_saving_test.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/auto_tests/file_saving_test.c b/auto_tests/file_saving_test.c
index 582013aa..8c3f10d4 100644
--- a/auto_tests/file_saving_test.c
+++ b/auto_tests/file_saving_test.c
@@ -34,9 +34,9 @@ static const char *pphrase = "bar", *name = "foo", *savefile = "./save";
34 34
35static void save_data_encrypted(void) 35static void save_data_encrypted(void)
36{ 36{
37 struct Tox_Options options; 37 struct Tox_Options *options = tox_options_new(NULL);
38 tox_options_default(&options); 38 Tox *t = tox_new(options, NULL);
39 Tox *t = tox_new(&options, NULL); 39 tox_options_free(options);
40 40
41 tox_self_set_name(t, (const uint8_t *)name, strlen(name), NULL); 41 tox_self_set_name(t, (const uint8_t *)name, strlen(name), NULL);
42 42
@@ -87,17 +87,17 @@ static void load_data_decrypted(void)
87 exit(3); 87 exit(3);
88 } 88 }
89 89
90 struct Tox_Options options; 90 struct Tox_Options *options = tox_options_new(NULL);
91 91
92 tox_options_default(&options); 92 tox_options_set_savedata_type(options, TOX_SAVEDATA_TYPE_TOX_SAVE);
93 93
94 tox_options_set_savedata_type(&options, TOX_SAVEDATA_TYPE_TOX_SAVE); 94 tox_options_set_savedata_data(options, clear, size);
95
96 tox_options_set_savedata_data(&options, clear, size);
97 95
98 TOX_ERR_NEW err; 96 TOX_ERR_NEW err;
99 97
100 Tox *t = tox_new(&options, &err); 98 Tox *t = tox_new(options, &err);
99
100 tox_options_free(options);
101 101
102 if (t == NULL) { 102 if (t == NULL) {
103 fprintf(stderr, "error: tox_new returned the error value %d\n", err); 103 fprintf(stderr, "error: tox_new returned the error value %d\n", err);