test if missing update works as expected

APPLEMAIL-24
Volker Birk 3 years ago
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;
}
}

@ -17,12 +17,12 @@ int main()
try {
string filename = update(p, "public.der");
cout << "downloaded " << filename << "\n";
return 0;
}
catch (DownloadError&)
{
cout << "cannot download\n";
return 1;
}
return 0;
}

Loading…
Cancel
Save