ProteoWizard
ClickwrapPrompterTest.cpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6//
7// Copyright 2010 Vanderbilt University - Nashville, TN 37232
8//
9// Licensed under the Apache License, Version 2.0 (the "License");
10// you may not use this file except in compliance with the License.
11// You may obtain a copy of the License at
12//
13// http://www.apache.org/licenses/LICENSE-2.0
14//
15// Unless required by applicable law or agreed to in writing, software
16// distributed under the License is distributed on an "AS IS" BASIS,
17// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18// See the License for the specific language governing permissions and
19// limitations under the License.
20//
21
22
23#include "unit.hpp"
24#include "ClickwrapPrompter.hpp"
25#include "Std.hpp"
26
27
28using namespace pwiz::util;
29
30
31ostream* os_ = 0;
32
33
34void test()
35{
36 unit_assert(ClickwrapPrompter::prompt("Test", "This is a test of the emergency prompting system.", "test"));
37}
38
39
40int main(int argc, char* argv[])
41{
42 TEST_PROLOG(argc, argv)
43
44 try
45 {
46 if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
47 if (os_) *os_ << "ClickwrapPrompterTest\n";
48 test();
49 }
50 catch (exception& e)
51 {
52 TEST_FAILED(e.what())
53 }
54 catch (...)
55 {
56 TEST_FAILED("Caught unknown exception.")
57 }
58
60}
int main(int argc, char *argv[])
ostream * os_
void test()
static bool prompt(const std::string &caption, const std::string &text, const std::string &oneTimeKey="")
shows a modal dialog with the specified caption, text, and Agree/Disagree buttons; returns true iff t...
#define unit_assert(x)
Definition unit.hpp:85
#define TEST_EPILOG
Definition unit.hpp:183
#define TEST_FAILED(x)
Definition unit.hpp:177
#define TEST_PROLOG(argc, argv)
Definition unit.hpp:175