|
Revision 644, 1.5 kB
(checked in by fujii, 3 years ago)
|
Add new netinstall source.
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
#if 0 |
|---|
| 17 |
static const char *cvsid = |
|---|
| 18 |
"\n%%% $Id: UserSettingTest.cc,v 1.1 2003/07/26 07:08:43 rbcollins Exp $\n"; |
|---|
| 19 |
#endif |
|---|
| 20 |
|
|---|
| 21 |
#include "site.h" |
|---|
| 22 |
#include "win32.h" |
|---|
| 23 |
#include <stdio.h> |
|---|
| 24 |
#include <stdlib.h> |
|---|
| 25 |
#include <string.h> |
|---|
| 26 |
#include <process.h> |
|---|
| 27 |
#include <algorithm> |
|---|
| 28 |
|
|---|
| 29 |
#include "LogSingleton.h" |
|---|
| 30 |
#include "io_stream.h" |
|---|
| 31 |
|
|---|
| 32 |
#include "port.h" |
|---|
| 33 |
#include "Exception.h" |
|---|
| 34 |
#include "UserSetting.h" |
|---|
| 35 |
#include "UserSettings.h" |
|---|
| 36 |
|
|---|
| 37 |
using namespace std; |
|---|
| 38 |
|
|---|
| 39 |
class TestSetting : public UserSetting { |
|---|
| 40 |
public: |
|---|
| 41 |
TestSetting(); |
|---|
| 42 |
static TestSetting &getInstance(); |
|---|
| 43 |
virtual void load(); |
|---|
| 44 |
virtual void save(); |
|---|
| 45 |
void testPassed(); |
|---|
| 46 |
private: |
|---|
| 47 |
static TestSetting Instance; |
|---|
| 48 |
bool loaded; |
|---|
| 49 |
bool saved; |
|---|
| 50 |
}; |
|---|
| 51 |
|
|---|
| 52 |
TestSetting & |
|---|
| 53 |
TestSetting::getInstance() |
|---|
| 54 |
{ |
|---|
| 55 |
return Instance; |
|---|
| 56 |
} |
|---|
| 57 |
|
|---|
| 58 |
TestSetting TestSetting::Instance; |
|---|
| 59 |
|
|---|
| 60 |
TestSetting::TestSetting() : loaded(false), saved(false) {} |
|---|
| 61 |
|
|---|
| 62 |
void |
|---|
| 63 |
TestSetting::load() |
|---|
| 64 |
{ |
|---|
| 65 |
loaded = true; |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
void |
|---|
| 69 |
TestSetting::save() |
|---|
| 70 |
{ |
|---|
| 71 |
saved = true; |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
void |
|---|
| 75 |
TestSetting::testPassed() |
|---|
| 76 |
{ |
|---|
| 77 |
if (saved) |
|---|
| 78 |
exit(1); |
|---|
| 79 |
if(loaded) |
|---|
| 80 |
exit(1); |
|---|
| 81 |
} |
|---|
| 82 |
|
|---|
| 83 |
#ifdef ASTEST |
|---|
| 84 |
int |
|---|
| 85 |
main (int argc, char **argv) |
|---|
| 86 |
{ |
|---|
| 87 |
TestSetting::getInstance().testPassed(); |
|---|
| 88 |
return 0; |
|---|
| 89 |
} |
|---|
| 90 |
#endif |
|---|