Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fail_unless! and unused imports. #2

Merged
merged 1 commit into from Apr 1, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -54,13 +54,13 @@ impl ToLl<css_font_family_e> for CssFontFamily {

impl ToLl<css_color> for CssColor {
pub fn to_ll(&self) -> css_color {
fail_unless!(sys::size_of::<CssColor>() == sys::size_of::<css_color>());
assert!(sys::size_of::<CssColor>() == sys::size_of::<css_color>());
unsafe { transmute(*self) }
}
}

pub fn ll_color_to_hl_color(color: css_color) -> CssColor {
fail_unless!(sys::size_of::<CssColor>() == sys::size_of::<css_color>());
assert!(sys::size_of::<CssColor>() == sys::size_of::<css_color>());
unsafe { transmute(color) }
}

@@ -138,7 +138,7 @@ pub fn ll_qname_to_hl_qname(qname: *css_qname) -> CssQName {
None
},
name: {
fail_unless!((*qname).name.is_not_null());
assert!((*qname).name.is_not_null());
ll_lwcstr_to_hl_lwcstr((*qname).name)
}
}
@@ -153,7 +153,7 @@ impl ToLl<css_pseudo_element> for CssPseudoElement {

pub fn c_enum_to_rust_enum<T>(val: c_enum) -> T {
// Sanity check that this is actually a 'c-like' (har) enum
fail_unless!(sys::size_of::<T>() == sys::size_of::<rust_enum>());
assert!(sys::size_of::<T>() == sys::size_of::<rust_enum>());
unsafe { transmute(val as rust_enum) }
}

@@ -47,7 +47,7 @@ pub mod types {
use wapcaplet::LwcString;
use ll::stylesheet::css_fixed;
use ll::hint::css_hint_length;
use conversions::{AsLl, ToLl};
use conversions::ToLl;

pub enum CssLanguageLevel {
CssLevel1,
@@ -209,7 +209,7 @@ pub mod stylesheet {

impl Drop for CssStylesheet {
fn finalize(&self) {
fail_unless!(self.sheet.is_not_null());
assert!(self.sheet.is_not_null());
let code = unsafe { css_stylesheet_destroy(self.sheet) };
require_ok(code, "destroying stylesheet");
}
@@ -222,7 +222,7 @@ pub mod stylesheet {
let code = ll_css_stylesheet_create(
to_unsafe_ptr(ll_params), realloc, null(), to_mut_unsafe_ptr(&mut sheet));
require_ok(code, "creating stylesheet");
fail_unless!(sheet.is_not_null());
assert!(sheet.is_not_null());
sheet
}
};
@@ -593,7 +593,7 @@ pub mod select {

impl Drop for CssSelectCtx {
fn finalize(&self) {
fail_unless!(self.select_ctx.is_not_null());
assert!(self.select_ctx.is_not_null());
let code = unsafe { css_select_ctx_destroy(self.select_ctx) };
require_ok(code, "destroying select ctx");
}
@@ -603,7 +603,7 @@ pub mod select {
let mut select_ctx: *css_select_ctx = null();
let code = unsafe { ll_css_select_ctx_create(realloc, null(), to_mut_unsafe_ptr(&mut select_ctx)) };
require_ok(code, "creating select context");
fail_unless!(select_ctx.is_not_null());
assert!(select_ctx.is_not_null());

CssSelectCtx {
select_ctx: select_ctx,
@@ -997,7 +997,7 @@ pub mod select {

impl Drop for CssSelectResults {
fn finalize(&self) {
fail_unless!(self.results.is_not_null());
assert!(self.results.is_not_null());
let code = unsafe { css_select_results_destroy(self.results) };
require_ok(code, "destroying select results");
}
@@ -1008,7 +1008,7 @@ pub mod select {
let element = element.to_ll();
let llstyle = unsafe { *self.results }.styles[element];
// FIXME: Rust #3926
fail_unless!((llstyle as *c_void).is_not_null());
assert!((llstyle as *c_void).is_not_null());

CssComputedStyle {
result_backref: self,
@@ -7,15 +7,15 @@ mod example1 {
use hint::*;
use select::*;
use util::VoidPtrLike;
use wapcaplet::{LwcString, from_rust_string};
use wapcaplet::LwcString;

struct MyDomNode {
name: @LwcString
}

impl VoidPtrLike for MyDomNode {
fn from_void_ptr(node: *libc::c_void) -> MyDomNode {
fail_unless!(node.is_not_null());
assert!(node.is_not_null());
MyDomNode {
name: unsafe {
let box = cast::reinterpret_cast(&node);
@@ -62,10 +62,10 @@ mod example1 {


let mut select_ctx: CssSelectCtx = css_select_ctx_create();
fail_unless!(select_ctx.count_sheets() == 0);
assert!(select_ctx.count_sheets() == 0);
select_ctx.append_sheet(sheet, CSS_ORIGIN_AUTHOR, CSS_MEDIA_ALL);
debug!("count sheets: %?", select_ctx.count_sheets());
fail_unless!(select_ctx.count_sheets() == 1);
assert!(select_ctx.count_sheets() == 1);

for uint::range(1, 7) |hh| {
let element = fmt!("h%u", hh);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.