forked from pEp.foundation/downloadclient
test if missing update works as expected
parent
b27fc73ee3
commit
a08c4b6eb1
@ -0,0 +1,29 @@
|
||||
// this file is under GNU General Public License 3.0
|
||||
// see LICENSE.txt
|
||||
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
#include "downloadclient.cc"
|
||||
|
||||
using namespace std;
|
||||
using namespace pEp::UpdateClient;
|
||||
|
||||
int main()
|
||||
{
|
||||
cout << "trying to download...\n";
|
||||
|
||||
// test server only supports serials with leading 23 so this must fail
|
||||
product p { "pEp for Something", "https://fdik.org/cgidownload?hash=42232323234242" };
|
||||
|
||||
try {
|
||||
string filename = update(p, "public.der");
|
||||
cout << "downloaded " << filename << "\n";
|
||||
return 1;
|
||||
}
|
||||
catch (DownloadError&)
|
||||
{
|
||||
cout << "cannot download\n";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue