Skip to content

Commit e551d30

Browse files
committed
test: remove some noise
Signed-off-by: William Casarin <[email protected]>
1 parent 6fc4d38 commit e551d30

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/nostrdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ static int ndb_filter_start_field_impl(struct ndb_filter *filter, enum ndb_filte
783783
struct ndb_filter_elements *els, *el;
784784

785785
if (ndb_filter_current_element(filter)) {
786-
fprintf(stderr, "ndb_filter_start_field: filter field already in progress, did you forget to call ndb_filter_end_field?\n");
786+
ndb_debug("ndb_filter_start_field: filter field already in progress, did you forget to call ndb_filter_end_field?\n");
787787
return 0;
788788
}
789789

test.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ static void test_reaction_counter()
359359
for (reactions = 0; reactions < num_reactions;) {
360360
results = ndb_wait_for_notes(ndb, subid, note_ids, num_reactions);
361361
reactions += results;
362-
fprintf(stderr, "got %d notes, total %d\n", results, reactions);
363362
assert(reactions > 0);
364363
}
365364

@@ -665,7 +664,6 @@ static void test_parse_contact_list()
665664
read_file("testdata/contacts.json", json, alloc_size, &written);
666665

667666
size = ndb_note_from_json((const char*)json, written, &note, buf, alloc_size);
668-
printf("ndb_note_from_json size %d\n", size);
669667
assert(size > 0);
670668
assert(size == 34328);
671669

@@ -689,9 +687,7 @@ static void test_parse_contact_list()
689687
assert(ndb_note_kind(note) == 3);
690688
assert(ndb_tags_count(ndb_note_tags(note)) == 786);
691689
//printf("note content length %d\n", ndb_note_content_length(note));
692-
printf("ndb_content_len %d, expected_len %ld\n",
693-
ndb_note_content_length(note),
694-
strlen(expected_content));
690+
//printf("ndb_content_len %d, expected_len %ld\n", ndb_note_content_length(note), strlen(expected_content));
695691
assert(ndb_note_content_length(note) == strlen(expected_content));
696692

697693
struct ndb_iterator iter, *it = &iter;
@@ -727,7 +723,7 @@ static void test_parse_contact_list()
727723
assert(total_elems == 1580);
728724

729725
write_file("test_contacts_ndb_note", (unsigned char *)note, size);
730-
printf("wrote test_contacts_ndb_note (raw ndb_note)\n");
726+
//printf("wrote test_contacts_ndb_note (raw ndb_note)\n");
731727

732728
free(json);
733729
free(buf);
@@ -813,7 +809,7 @@ static void test_fetch_last_noteid()
813809

814810
assert(root);
815811
int res = NdbProfileRecord_verify_as_root(root, len);
816-
printf("NdbProfileRecord verify result %d\n", res);
812+
//printf("NdbProfileRecord verify result %d\n", res);
817813
assert(res == 0);
818814

819815
NdbProfileRecord_table_t profile_record = NdbProfileRecord_as_root(root);
@@ -826,7 +822,7 @@ static void test_fetch_last_noteid()
826822
assert(!strcmp(name, "jb55"));
827823
assert(!strcmp(lnurl, "fixme"));
828824

829-
printf("note_key %" PRIu64 "\n", key);
825+
//printf("note_key %" PRIu64 "\n", key);
830826

831827
struct ndb_note *n = ndb_get_note_by_key(&txn, key, NULL);
832828
ndb_end_query(&txn);
@@ -1527,7 +1523,7 @@ static void test_query()
15271523

15281524
count = 0;
15291525
assert(ndb_query(&txn, f, 1, results, cap, &count));
1530-
ndb_print_kind_keys(&txn);
1526+
//ndb_print_kind_keys(&txn);
15311527
assert(count == 2);
15321528
assert(!strcmp(ndb_note_content(results[0].note), "hmm"));
15331529
assert(!strcmp(ndb_note_content(results[1].note), "what"));
@@ -1834,7 +1830,6 @@ static void test_filter_parse_search_json() {
18341830

18351831
// test back to json
18361832
assert(ndb_filter_json(f, (char *)buf, sizeof(buf)));
1837-
printf("search json: '%s'\n", (const char *)buf);
18381833
assert(!strcmp((const char*)buf, json));
18391834

18401835
ndb_filter_destroy(f);
@@ -1879,8 +1874,6 @@ static void test_note_relay_index()
18791874
assert(ndb_wait_for_notes(ndb, subid, &note_key, 1) == 1);
18801875
assert(note_key > 0);
18811876

1882-
sleep(1);
1883-
18841877
// 4) Check that we have both relays
18851878
assert(ndb_begin_query(ndb, &txn));
18861879
assert(ndb_note_seen_on_relay(&txn, note_key, "wss://relay.damus.io"));

0 commit comments

Comments
 (0)