summaryrefslogtreecommitdiffstats
path: root/tests/id.test
blob: 7e3f9588bfd71610f723ebca03c192314cf0f792 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# This file is a Tcl script to test out the procedures in the file
# tkId.c, which recycle X resource identifiers.  It is organized in
# the standard fashion for Tcl tests.
#
# Copyright (c) 1995 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id: id.test,v 1.6 2002/07/13 21:52:34 dgp Exp $

package require tcltest 2.1
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
tcltest::loadTestedCommands

test id-1.1 {WindowIdCleanup, delaying window release} {unixOnly testwrapper} {
    bind all <Destroy> {lappend x %W}
    catch {unset map}
    frame .f
    set j 0
    foreach i {a b c d e f g h i j k l m n o p q} {
	toplevel .f.$i -height 50 -width 100
	wm geometry .f.$i +$j+$j
	incr j 10
	update
	set map([winfo id .f.$i]) .f.$i
	set map([testwrapper .f.$i]) wrapper.f.$i
    }
    set x {}
    destroy .f

    # Destroy events should have occurred for all windows.
    set result [list [lsort $x]]

    set x {}
    update idletasks
    set reused {}
    foreach i {a b c d e} {
	set w .${i}2
	frame $w -height 20 -width 100 -bd 2 -relief raised
	pack $w
	if [info exists map([winfo id $w])] {
	    lappend reused $map([winfo id $w])
	}
	set map([winfo id $w]) $w
    }

    # No window ids should have been reused: stale Destroy events still
    # pending in queue.
    lappend result [lsort $reused]

    # Wait a few seconds, then try again;  ids should still not have
    # been re-used.

    set y 0
    after 2000 {set y 1}
    tkwait variable y
    foreach i {a b c} {
	set w .${i}3
	frame $w -height 20 -width 100 -bd 2 -relief raised
	pack $w
	if [info exists map([winfo id $w])] {
	    lappend reused $map([winfo id $w])
	}
	set map([winfo id $w])] $w
    }

    # Ids should not yet have been reused.
    lappend result [lsort $reused]


    # Wait a few more seconds, to give ids enough time to be recycled.
    set y 0
    after 6000 {set y 1}
    tkwait variable y
    foreach i {a b c d e f} {
	set w .${i}4
	frame $w -height 20 -width 100 -bd 2 -relief raised
	pack $w
	if [info exists map([winfo id $w])] {
	    lappend reused $map([winfo id $w])
	}
	set map([winfo id $w])] $w
    }

    # Ids should be reused now, due to time delay.  Destroy events should
    # have been discarded.
    lappend result [lsort $reused] [lsort $x]
} {{.f .f.a .f.b .f.c .f.d .f.e .f.f .f.g .f.h .f.i .f.j .f.k .f.l .f.m .f.n .f.o .f.p .f.q} {} {} {.f.o .f.p .f.q wrapper.f.p wrapper.f.q} {}}
bind all <Destroy> {}

# cleanup
::tcltest::cleanupTests
return













='del'>-void cmELFByteSwap(char* /*unused*/, cmELFByteSwapSize<1> const& /*unused*/)
+void cmELFByteSwap(char* /*unused*/, cmELFByteSwapSize<1> /*unused*/)
{
}
-void cmELFByteSwap(char* data, cmELFByteSwapSize<2> const& /*unused*/)
+void cmELFByteSwap(char* data, cmELFByteSwapSize<2> /*unused*/)
{
char one_byte;
one_byte = data[0];
data[0] = data[1];
data[1] = one_byte;
}
-void cmELFByteSwap(char* data, cmELFByteSwapSize<4> const& /*unused*/)
+void cmELFByteSwap(char* data, cmELFByteSwapSize<4> /*unused*/)
{
char one_byte;
one_byte = data[0];
@@ -73,7 +73,7 @@ void cmELFByteSwap(char* data, cmELFByteSwapSize<4> const& /*unused*/)
data[1] = data[2];
data[2] = one_byte;
}
-void cmELFByteSwap(char* data, cmELFByteSwapSize<8> const& /*unused*/)
+void cmELFByteSwap(char* data, cmELFByteSwapSize<8> /*unused*/)
{
char one_byte;
one_byte = data[0];
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 32a539c..77b0d13 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1121,9 +1121,9 @@ protected:
bool InstallSymlink(const char* fromFile, const char* toFile);
bool InstallFile(const char* fromFile, const char* toFile,
- MatchProperties const& match_properties);
+ MatchProperties match_properties);
bool InstallDirectory(const char* source, const char* destination,
- MatchProperties const& match_properties);
+ MatchProperties match_properties);
virtual bool Install(const char* fromFile, const char* toFile);
virtual std::string const& ToName(std::string const& fromName)
{
@@ -1542,7 +1542,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile)
}
bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
- MatchProperties const& match_properties)
+ MatchProperties match_properties)
{
// Determine whether we will copy the file.
bool copy = true;
@@ -1596,7 +1596,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
bool cmFileCopier::InstallDirectory(const char* source,
const char* destination,
- MatchProperties const& match_properties)
+ MatchProperties match_properties)
{
// Inform the user about this directory installation.
this->ReportCopy(destination, TypeDir,
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index ea031cf..9327c18 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -212,7 +212,8 @@ std::string cmFindProgramCommand::FindAppBundle()
return "";
}
-std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
+std::string cmFindProgramCommand::GetBundleExecutable(
+ std::string const& bundlePath)
{
std::string executable;
(void)bundlePath;
diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h
index a0d6af9..b0cd420 100644
--- a/Source/cmFindProgramCommand.h
+++ b/Source/cmFindProgramCommand.h
@@ -43,7 +43,7 @@ private:
std::string FindNormalProgramDirsPerName();
std::string FindNormalProgramNamesPerDir();
std::string FindAppBundle();
- std::string GetBundleExecutable(std::string bundlePath);
+ std::string GetBundleExecutable(std::string const& bundlePath);
};
#endif
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9a33bec..24decea 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -76,7 +76,7 @@ public:
cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
void CreatePropertyGeneratorExpressions(
- cmStringRange const& entries, cmBacktraceRange const& backtraces,
+ cmStringRange entries, cmBacktraceRange backtraces,
std::vector<cmGeneratorTarget::TargetPropertyEntry*>& items,
bool evaluateForBuildsystem = false)
{
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 67e272d..b32f4e4 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1482,13 +1482,13 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
}
cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir) const
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) const
{
return new cmLinkLineComputer(outputConverter, stateDir);
}
cmLinkLineComputer* cmGlobalGenerator::CreateMSVC60LinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir) const
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) const
{
return new cmMSVC60LinkLineComputer(outputConverter, stateDir);
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index cc7ffed..871178b 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h