mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 01:09:37 +01:00
test/libutil: Add OBSERVE_STRING macro
Makes string callback easier to pass, without mistakes.
This commit is contained in:
parent
876e70bc9a
commit
a512f4eebc
4 changed files with 33 additions and 20 deletions
9
tests/unit/libutil-support/tests/string_callback.cc
Normal file
9
tests/unit/libutil-support/tests/string_callback.cc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include "string_callback.hh"
|
||||
|
||||
namespace nix::testing {
|
||||
|
||||
void observe_string_cb(const char * start, unsigned int n, std::string * user_data) {
|
||||
*user_data = std::string(start);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue