Exemplo n.º 1
0
static bool interface_tests_i(const char* pszHost)
{
	output("\n");

	for (const char** pszDlls = get_dlls(); *pszDlls; ++pszDlls)
	{
		bool bSkipped;
		bool res = do_library_test(make_absolute(*pszDlls),pszHost,bSkipped);

		unregister_library("/Local User");

		if (res && !bSkipped)
			output("[Ok]\n");
	}

	output("  %-46s","Result");

	for (const char** pszExes = get_exes(); *pszExes; ++pszExes)
	{
		bool bSkipped;
		bool res = do_process_test(make_absolute(*pszExes),pszHost,bSkipped);

		unregister_process("/Local User");

		if (res && !bSkipped)
			output("[Ok]\n");
	}

	output("  %-46s","Result");
	return true;
}
Exemplo n.º 2
0
void _NonAppStop( void )
{
/* Here we clean up any resources we allocated. Resource tags is a big part
 * of what we created, but NetWare doesn't ask us to free those.
 */
	(void) unregister_library(gLibId);
	NXMutexFree(gLibLock);
}
Exemplo n.º 3
0
bool interface_dll_tests()
{
	output("\n");

	for (const char** pszDlls = get_dlls(); *pszDlls; ++pszDlls)
	{
		// Register the library
		Omega::string_t strLibName = make_absolute(*pszDlls);
		output("  %-45s",strLibName.c_str());

		// Register the library
		bool bSkipped;
		bool res = register_library("/Local User",strLibName,bSkipped);
		if (bSkipped)
			continue;

		if (res)
		{
			output("\n");

			res = do_local_library_test("/Local User");

			unregister_library("/Local User");

			if (res)
				output("[Ok]");
		}

		res = register_library("/All Users",strLibName,bSkipped);
		if (res && !bSkipped)
		{
			output("\n");

			res = do_local_library_test("/All Users");

			unregister_library("/All Users");

			if (res)
				output("[Ok]\n");
		}
	}

	output("  %-46s","Result");
	return true;
}
Exemplo n.º 4
0
void _NonAppStop( void )
{
    apr_pool_terminate();

    WSACleanup();

    unregister_library(gLibId);
    NXMutexFree(gLibLock);
}
Exemplo n.º 5
0
static bool do_library_test(const Omega::string_t& strLibName, const char* pszEndpoint, bool& bSkipped)
{
	// Register the library ready for local loopback stuff
	output("  %-45s ",strLibName.c_str());

	// Register the library
	TEST(register_library("/Local User",strLibName,bSkipped));
	if (bSkipped)
		return true;

	OTL::ObjectPtr<Omega::TestSuite::ISimpleTest> ptrSimpleTest("Test.Library@" + Omega::string_t(pszEndpoint));
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	TEST(unregister_library("/Local User"));

	return true;
}
Exemplo n.º 6
0
/*
** Here we clean up any resources we allocated. Resource tags is a big part
** of what we created, but NetWare doesn't ask us to free those.
*/
void _NonAppStop( void )
{
  (void) unregister_library(gLibId);
  NXMutexFree(gLibLock);
}
Exemplo n.º 7
0
static bool do_local_library_test(const Omega::string_t& strPrefix)
{
	output("    %-43s ",("'" + strPrefix + "/' registry key").c_str());

	// Test the simplest case
	OTL::ObjectPtr<Omega::TestSuite::ISimpleTest> ptrSimpleTest(Omega::TestSuite::OID_TestLibrary,Omega::Activation::Library);
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	// Test for local activation
	ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>(Omega::TestSuite::OID_TestLibrary.ToString());
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	// Test for local activation
	ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>("Test.Library");
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	// Test for local activation with '@local'
	ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>("Test.Library@local");
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	// Test for local activation with '@local'
	ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>(Omega::TestSuite::OID_TestLibrary.ToString() + "@local");
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	// Test redirecting the registration
	OTL::ObjectPtr<Omega::Registry::IKey> ptrKey("/Local User/Objects",Omega::Registry::IKey::OpenCreate);
	OTL::ObjectPtr<Omega::Registry::IKey> ptrSubKey = ptrKey->OpenKey("MyLittleTest",Omega::Registry::IKey::OpenCreate);
	ptrSubKey->SetValue("CurrentVersion","Test.Library");

	ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>("MyLittleTest@local");
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	// Test it has gone
	ptrKey->DeleteSubKey("MyLittleTest");
	try
	{
		ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>("MyLittleTest");
	}
	catch (Omega::INotFoundException* pE)
	{
		add_success();
		pE->Release();
	}

	// Test for surrogate activation
	ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>(Omega::TestSuite::OID_TestLibrary,Omega::Activation::Process);
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	ptrSimpleTest.Release();

	// Test unregistering
	TEST(unregister_library(strPrefix));

	try
	{
		ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>("Test.Library");
	}
	catch (Omega::INotFoundException* pE)
	{
		add_success();
		pE->Release();
	}

	try
	{
		ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>(Omega::TestSuite::OID_TestLibrary);
	}
	catch (Omega::INotFoundException* pE)
	{
		add_success();
		pE->Release();
	}

	// Now test the sand-box surrogate activation
/*
	// Register the library
	TEST(register_library("/System/Sandbox",strLibName,bSkipped));
	if (bSkipped)
		return true;

	// Test for surrogate activation
	ptrSimpleTest = OTL::ObjectPtr<Omega::TestSuite::ISimpleTest>(Omega::TestSuite::OID_TestLibrary,Omega::Activation::Sandbox);
	TEST(ptrSimpleTest);
	interface_tests(ptrSimpleTest);

	TEST(unregister_library("/System/Sandbox"));*/

	return true;
}