mirror of
https://github.com/QRouland/UTPass.git
synced 2025-06-25 15:02:28 +00:00
Complete rewrite from gpgme to rnp
This commit is contained in:
@ -17,7 +17,7 @@ private:
|
||||
public:
|
||||
~TesTPassphraseProvider() = default;
|
||||
|
||||
static TesTPassphraseProvider& instance()
|
||||
static TesTPassphraseProvider &instance()
|
||||
{
|
||||
static TesTPassphraseProvider instance;
|
||||
return instance;
|
||||
@ -26,15 +26,16 @@ public:
|
||||
void operator=(TesTPassphraseProvider const &) = delete;
|
||||
|
||||
|
||||
static bool
|
||||
example_pass_provider(rnp_ffi_t ffi,
|
||||
void * app_ctx,
|
||||
rnp_key_handle_t key,
|
||||
const char * pgp_context,
|
||||
char buf[],
|
||||
size_t buf_len)
|
||||
{ strncpy(buf, "utpasspassphrase", buf_len);
|
||||
static bool
|
||||
example_pass_provider(rnp_ffi_t ffi,
|
||||
void *app_ctx,
|
||||
rnp_key_handle_t key,
|
||||
const char *pgp_context,
|
||||
char buf[],
|
||||
size_t buf_len)
|
||||
{
|
||||
strncpy(buf, "utpasspassphrase", buf_len);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
@ -21,9 +21,8 @@ PassTestCase {
|
||||
}
|
||||
|
||||
function test_pass_show(data) {
|
||||
if (data.add_home_gpg_data === true) {
|
||||
if (data.add_home_gpg_data === true)
|
||||
TestsUtils.copyFolder(Qt.resolvedUrl("../../assets/gpghome"), Qt.resolvedUrl(gpg_home));
|
||||
}
|
||||
|
||||
var fname, ctext;
|
||||
Pass.showSucceed.connect(function(file_name, clear_text) {
|
||||
@ -34,14 +33,12 @@ PassTestCase {
|
||||
Pass.showFailed.connect(function(err) {
|
||||
err_msg = err;
|
||||
});
|
||||
|
||||
Pass.show(Qt.resolvedUrl(data.file));
|
||||
data.spy.wait();
|
||||
if (data.err_msg) {
|
||||
if (data.err_msg)
|
||||
verify(err_msg === data.err_msg, "Should return %1 but return %2".arg(data.err_msg).arg(err_msg));
|
||||
} else {
|
||||
else
|
||||
verify(false);
|
||||
}
|
||||
}
|
||||
|
||||
SignalSpy {
|
||||
|
Reference in New Issue
Block a user