Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Noric Couderc
JBrainy
Commits
6b6c07c7
Commit
6b6c07c7
authored
Dec 22, 2021
by
Noric Couderc
Browse files
Enabled start/stop when testing counters
A bit more thorough, you test they start/stop correctly.
parent
f8f59ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/src/main/kotlin/se/lth/cs/papicounters/PAPICounter.kt
View file @
6b6c07c7
...
...
@@ -6,7 +6,6 @@ import papi.PapiException
import
se.lth.cs.CounterSpecification
import
se.lth.cs.util.Feature
import
se.lth.cs.util.FeatureVisitor
import
java.lang.RuntimeException
class
PAPICounter
(
val
counter
:
String
)
:
Feature
()
{
fun
isValid
():
Boolean
{
...
...
@@ -17,14 +16,14 @@ class PAPICounter(val counter : String) : Feature() {
Papi
.
init
()
try
{
val
eventSet
=
EventSet
.
create
(
this
.
toPAPIConstant
()
!!
)
//
eventSet.start()
//
var x = 0
//
//
Some random crap
//
for (i in 0 until 10) {
//
x += x * 2 - 3
//
}
//
eventSet.stop()
//
eventSet.destroy()
eventSet
.
start
()
var
x
=
0
// Some random crap
for
(
i
in
0
until
10
)
{
x
+=
x
*
2
-
3
}
eventSet
.
stop
()
eventSet
.
destroy
()
return
true
}
catch
(
e
:
PapiException
)
{
return
false
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment