Adding extra source file to TC winscw test code, and fixing it so it works fix
authorIain Williamson <iain.williamson@nokia.com>
Tue, 02 Feb 2010 16:08:55 +0000
branchfix
changeset 184 860699b2b944
parent 183 7c04ad290aca
child 185 69334660be7a
Adding extra source file to TC winscw test code, and fixing it so it works
sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsStaticDLL.cpp
sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsStaticDLL.mmp
sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsfiletwo.cpp
sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsfiletwo.h
sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/traces/OstTraceDefinitions.h
--- a/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsStaticDLL.cpp	Fri Jan 29 17:36:06 2010 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsStaticDLL.cpp	Tue Feb 02 16:08:55 2010 +0000
@@ -21,7 +21,7 @@
 #include <e32uid.h>
 #include "OstTraceDefinitions.h"
 #ifdef OST_TRACE_COMPILER_IN_USE
-#include "CreateStaticDLLTraces.h"
+#include "tcwinsStaticDLLTraces.h"
 #endif
 
 
@@ -48,7 +48,6 @@
 
 CMessenger::~CMessenger() // destruct - virtual, so no export
 	{
-	TraceDump( INFO_LEVEL, ( _L( "CMessenger::~CMessenger()" ) ) );
 	OstTrace0( TRACE_API, DUP1_CMESSENGER_CMESSENGER, "CMessenger::~CMessenger()" );
 	OstTrace0( TRACE_NORMAL, DUP2_CMESSENGER_CMESSENGER, "CMessenger::~CMessenger()" );  
 	delete iString;
--- a/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsStaticDLL.mmp	Fri Jan 29 17:36:06 2010 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsStaticDLL.mmp	Tue Feb 02 16:08:55 2010 +0000
@@ -25,10 +25,13 @@
 VENDORID 0x70000001
 
 SOURCEPATH    .
-SOURCE        CreateStaticDLL.cpp
+SOURCE        tcwinsStaticDLL.cpp
+SOURCE        tcwinsfiletwo.cpp
 
 USERINCLUDE   .
 SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/internal
+USERINCLUDE traces
 
 LIBRARY       euser.lib
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsfiletwo.cpp	Tue Feb 02 16:08:55 2010 +0000
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* This program creates a dll.
+*
+*/
+
+
+#include "tcwinsfiletwo.h"
+#include <e32uid.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tcwinsfiletwoTraces.h"
+#endif
+
+
+// construct/destruct
+
+
+extern "C" void __ARM_switch8();
+
+EXPORT_C CMessenger2* CMessenger2::NewLC(CConsoleBase& aConsole, const TDesC& aString)
+	{
+	OstTrace0( TRACE_NORMAL, DUP1_CMESSENGER2_NEWL, "CMessenger2::NewLC()" );  
+	CMessenger2* self=new (ELeave) CMessenger2(aConsole);
+	CleanupStack::PushL(self);
+	self->ConstructL(aString);
+	return self;
+	}
+
+CMessenger2::~CMessenger2() // destruct - virtual, so no export
+	{
+	OstTrace0( TRACE_API, DUP1_CMESSENGER2_CMESSENGER2, "CMessenger2::~CMessenger2()" );
+	delete iString;
+	}
+
+EXPORT_C void CMessenger2::ShowMessage()
+	{
+	_LIT(KFormat1,"%S\n");
+	iConsole.Printf(KFormat1, iString); // notify completion
+	}
+
+// constructor support
+// don't export these, because used only by functions in this DLL, eg our NewLC()
+
+CMessenger2::CMessenger2(CConsoleBase& aConsole) // first-phase C++ constructor
+	: iConsole(aConsole)
+	{
+	}
+
+void CMessenger2::ConstructL(const TDesC& aString) // second-phase constructor
+	{
+	iString=aString.AllocL(); // copy given string into own descriptor
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsfiletwo.h	Tue Feb 02 16:08:55 2010 +0000
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+ 
+
+#include <e32cons.h>
+
+
+class CMessenger2 : public CBase
+  	{
+public:
+		// Construction
+	IMPORT_C static CMessenger2* NewLC(CConsoleBase& aConsole, const TDesC& aString);
+		// Destructor - virtual and class not intended
+		// for derivation, so not exported
+	~CMessenger2();
+		// general functions - exported
+	IMPORT_C void ShowMessage();
+private:
+		// C++ constructor - not exported;
+		// implicitly called from NewLC()
+	CMessenger2(CConsoleBase& aConsole);
+		// 2nd phase construction, called by NewLC()
+	void ConstructL(const TDesC& aString); // second-phase constructor
+private:
+	CConsoleBase& iConsole; // Use the console (but not owned)
+	HBufC*        iString;  // Allocated container for string data (destructor destroys)
+	};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/traces/OstTraceDefinitions.h	Tue Feb 02 16:08:55 2010 +0000
@@ -0,0 +1,7 @@
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+#define OST_TRACE_COMPILER_IN_USE
+#include <OpenSystemTrace.h>
+#endif