Commit Graph

3 Commits

Author SHA1 Message Date
David Benjamin
55696cecde Remove lh_new's default hash and comparator.
This is a memory error for anything other than LHASH_OF(char), which
does not exist.

No code outside the library creates (or even queries) an LHASH, so we
can change this module freely.

Change-Id: Ifbc7a1c69a859e07650fcfaa067bdfc68d83fbbc
Reviewed-on: https://boringssl-review.googlesource.com/12978
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2017-01-04 01:44:10 +00:00
David Benjamin
c42a771d7d Test LHASH contents with lh_doall_arg.
Use it to compare the contents of lh and dummy_lh are identical. Leave a
TODO for testing other LHASH cases.

Change-Id: Ifbaf17c196070fdff1530ba0e284030527855f5d
Reviewed-on: https://boringssl-review.googlesource.com/12977
Reviewed-by: Adam Langley <agl@google.com>
2017-01-04 01:41:55 +00:00
David Benjamin
ca0642287d Rewrite lhash_test in C++.
Use a std::map as the dummy lhash and use unique_ptr. This also improves
the test to check on pointer equality; we wish to ensure the lhash
stores the particular pointer value we asked for.

dummy_lh now also owns the pointers. It makes things simpler and since
LHASH doesn't free things, we weren't getting anything out of testing
that.

Change-Id: I97159175ca79a5874586650f272a7846100395e1
Reviewed-on: https://boringssl-review.googlesource.com/12976
Reviewed-by: Adam Langley <agl@google.com>
2017-01-04 01:38:45 +00:00