Skip to content

Commit a7ea0d3

Browse files
stephenhinesAndroid (Google) Code Review
authored andcommitted
Merge "Add unit tests for convert (with relaxed precision)." into jb-dev
2 parents 5301a56 + 724de98 commit a7ea0d3

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public void init(RenderScriptGL rs, Resources res, int width, int height) {
7272
unitTests.add(new UT_clamp(this, mRes, mCtx));
7373
unitTests.add(new UT_clamp_relaxed(this, mRes, mCtx));
7474
unitTests.add(new UT_convert(this, mRes, mCtx));
75+
unitTests.add(new UT_convert_relaxed(this, mRes, mCtx));
7576
unitTests.add(new UT_rsdebug(this, mRes, mCtx));
7677
unitTests.add(new UT_rstime(this, mRes, mCtx));
7778
unitTests.add(new UT_rstypes(this, mRes, mCtx));
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (C) 2012 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.rs.test;
18+
19+
import android.content.Context;
20+
import android.content.res.Resources;
21+
import android.renderscript.*;
22+
23+
public class UT_convert_relaxed extends UnitTest {
24+
private Resources mRes;
25+
26+
protected UT_convert_relaxed(RSTestCore rstc, Resources res, Context ctx) {
27+
super(rstc, "Convert (Relaxed)", ctx);
28+
mRes = res;
29+
}
30+
31+
public void run() {
32+
RenderScript pRS = RenderScript.create(mCtx);
33+
ScriptC_convert_relaxed s =
34+
new ScriptC_convert_relaxed(pRS, mRes, R.raw.convert_relaxed);
35+
pRS.setMessageHandler(mRsMessage);
36+
s.invoke_convert_test();
37+
pRS.finish();
38+
waitForMessage();
39+
pRS.destroy();
40+
}
41+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "convert.rs"
2+
#pragma rs_fp_relaxed

0 commit comments

Comments
 (0)