summaryrefslogtreecommitdiffstats
path: root/private/unimodem/new/mic/tdev.cpp
blob: 2e32384f1d8c03aa2977121a12c771624484997b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//						
//		Copyright (c) 1996 Microsoft Corporation
//
//
//		TDEV.CPP		-- Component tests  for classes:
//									CIndDevice
//						
//		Copyright (c) 1996 Microsoft Corporation
//
//
//		History:
//			05/22/96	JosephJ		Created
//
#include "common.h"
#include "ini.h"
#include "inf.h"
#include "dev.h"
#include "test.h"

#define SIMPLE 0
#define COMPLEX 1
#define ACTUAL 2

//#define TEST_TYPE (SIMPLE)
#define TEST_TYPE (COMPLEX)
//#define TEST_TYPE (ACTUAL)


#if (TEST_TYPE==SIMPLE)
#elif (TEST_TYPE==COMPLEX)
#elif (TEST_TYPE==ACTUAL)
#endif

int main_tdev(int argc, char * argv[])
{
	CInfFile *pInf= new CInfFile();
	CInfDevice *pDev = new CInfDevice(NULL);

	const CInfManufacturerEntry *pManuE = NULL;
	const CInfManufacturerSection *pManuS = NULL;
	const CInfModelEntry		*pModelE = NULL;

	//__try 
	{
		//__try 
		{
			if (pInf->Load("test.inf"))
			{
				pManuE = pInf->GetFirstManufacturerEntry();
			}
			if (pManuE)
			{
				pManuS = pManuE->GetManufacturerSection();
			}
			if (pManuS)
			{
				pModelE = pManuS->GetFirstModelEntry();
			}
			if (pModelE)
			{
				if (pDev->Load(pInf, pManuE, pModelE))
				{
					pDev->Dump();
					pDev->WriteInf(TEXT("out.inf"));
				}
			}

		}
		//__finally
		{
			// printf("in finally\n");
			if (pDev) {pDev->Unload(); delete pDev; pDev=NULL;}
			if (pInf) {pInf->Unload(); delete pInf; pInf=NULL;}
		}
	}
	//__except(printf("in filter\n"), EXCEPTION_EXECUTE_HANDLER)
	if (0) {
		printf("in except\n");
		ASSERT(FALSE);
	}


	return 0;
}